Catch MissingWebViewPackageException, no WebView installed#1454
Conversation
jkasten2
left a comment
There was a problem hiding this comment.
Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @nan-li)
OneSignalSDK/onesignal/src/main/java/com/onesignal/WebViewManager.java, line 150 at r1 (raw file):
public void run() { // This try-catch is added to address this error when OSWebView is created // MissingWebViewPackageException: Failed to load WebView provider: No WebView installed
Comment could be simplified to:
// Handles exception "MissingWebViewPackageException: Failed to load WebView provider: No WebView installed"OneSignalSDK/onesignal/src/main/java/com/onesignal/WebViewManager.java, line 154 at r1 (raw file):
webViewManager.setupWebView(currentActivity, base64Str); } catch (Exception e) { if (e.getMessage() != null && e.getMessage().contains("WebView")) {
Would be good to callout here that MissingWebViewPackageException isn't public so checking the message of the exception to only catch that specific one.
OneSignalSDK/onesignal/src/main/java/com/onesignal/WebViewManager.java, line 156 at r1 (raw file):
if (e.getMessage() != null && e.getMessage().contains("WebView")) { OneSignal.Log(OneSignal.LOG_LEVEL.ERROR, "Error setting up WebView: ", e); e.printStackTrace();
We can omit this line, since we are using OneSignal.Log above to print the message.
1fa3531 to
3cf992d
Compare
nan-li
left a comment
There was a problem hiding this comment.
Reviewable status: 0 of 1 files reviewed, 3 unresolved discussions (waiting on @jkasten2)
OneSignalSDK/onesignal/src/main/java/com/onesignal/WebViewManager.java, line 150 at r1 (raw file):
Previously, jkasten2 (Josh Kasten) wrote…
Comment could be simplified to:
// Handles exception "MissingWebViewPackageException: Failed to load WebView provider: No WebView installed"
Done.
OneSignalSDK/onesignal/src/main/java/com/onesignal/WebViewManager.java, line 154 at r1 (raw file):
Previously, jkasten2 (Josh Kasten) wrote…
Would be good to callout here that
MissingWebViewPackageExceptionisn't public so checking the message of the exception to only catch that specific one.
Done.
OneSignalSDK/onesignal/src/main/java/com/onesignal/WebViewManager.java, line 156 at r1 (raw file):
Previously, jkasten2 (Josh Kasten) wrote…
We can omit this line, since we are using
OneSignal.Logabove to print the message.
Done.
jkasten2
left a comment
There was a problem hiding this comment.
Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @nan-li)
See Github Issue #1453
This change is