-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make web views inspectable #1286
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello thank you for your contribution! It looks like this is failing to build. I believe the Objective-C version of this property is named inspectable
(the getter is isInspectable
)
Awesome, thanks! I pushed a fix, do you have guidance about getting this to build in an existing project? I wasn't able to due to certificate signing issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question you likely need to change the bundle id and development team in the dev app. One last fix
Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @casey-chow, @jkasten2, and @rgomezp)
iOS_SDK/OneSignalSDK/Source/OneSignalWebView.m
line 45 at r1 (raw file):
_webView.navigationDelegate = self; // https://webkit.org/blog/13936/enabling-the-inspection-of-web-content-in-apps/ if (@available(macOS 13.3, iOS 16.4, *)) {
Let's add a condition to this to only enable inspectability if the app is being run in debug mode.
iOS_SDK/OneSignalSDK/Source/OSInAppMessageView.m
line 114 at r1 (raw file):
self.webView.opaque = NO; // https://webkit.org/blog/13936/enabling-the-inspection-of-web-content-in-apps/ if (@available(macOS 13.3, iOS 16.4, *)) {
Let's add a condition to this to only enable inspectability if the app is being run in debug mode.
The main issue I'm facing is our web developers are facing issues in the production version of the app, so we'd like to have access in TestFlight. This is especially important because we need to test against production data/non-sandbox environment, which we can't on a debug build. The other option would be to expose this configuration in the API, but I opted to avoid making any API changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense in order to allow debugging in TestFlight lets have the condition be OneSignal's log level as debug or higher. I do not want to have inspectability on by default. This behavior would also match the Android SDK's Webview inspectability behavior.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @casey-chow, @jkasten2, and @rgomezp)
@emawby made the requisite changes, please take a look! |
Description
One Line Summary
Adds Safari inspectability for all WKWebView instances, closes #1277. See https://webkit.org/blog/13936/enabling-the-inspection-of-web-content-in-apps/ for details.
Details
Motivation
This PR allows developers to view WKWebView instances inside Safari's inspection mechanism for iOS devices. This is necessary for us to verify click tracking in OneSignal Web Views.
Testing
No automated testing added since this is functionally a configuration change.
Manual testing
I've not been able to succeed testing this, seems like the framework cannot be built without certificates.
Affected code checklist
Checklist
Overview
Testing
Final pass
This change is