Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

shouldOverrideUrlLoading - Android #66

Closed
wmcshane opened this issue Mar 19, 2019 · 11 comments
Closed

shouldOverrideUrlLoading - Android #66

wmcshane opened this issue Mar 19, 2019 · 11 comments

Comments

@wmcshane
Copy link

I can't seem to get shouldOverrideUrlLoading working on android. I have tested the Example app as well, just to be sure it wasn't my projects setup, however, i see the same issue.

It works fine on IOS, just not Android.

I see the following in the console whenever the InAppWebView is present:
W/art (13736): Attempt to remove non-JNI local reference, dumping thread
W/art (13736): Attempt to remove non-JNI local reference, dumping thread
W/art (13736): Attempt to remove non-JNI local reference, dumping thread
W/art (13736): Attempt to remove non-JNI local reference, dumping thread
W/art (13736): Attempt to remove non-JNI local reference, dumping thread
W/art (13736): Attempt to remove non-JNI local reference, dumping thread
W/art (13736): Attempt to remove non-JNI local reference, dumping thread
W/art (13736): Attempt to remove non-JNI local reference, dumping thread
W/art (13736): Attempt to remove non-JNI local reference, dumping thread
W/art (13736): Attempt to remove non-JNI local reference, dumping thread
W/art (13736): Attempt to remove non-JNI local reference, dumping thread
W/art (13736): Attempt to remove non-JNI local reference, dumping thread
W/cr_BindingManager(13736): Cannot call determinedVisibility() - never saw a connection for the pid: 13736

Anyone else experiencing this?

This was referenced Jul 6, 2020
@AlexV525
Copy link
Contributor

This might cause by calling JavaScript binding before onPageFinished too soon on some lower version on Android, e.g. 6 or 7. A possible solution will be make a post delay when loading the custom scripts on lower version of Android.

@AlexV525
Copy link
Contributor

cc @pichillilorenzo

@mehmetsukrumumbucoglu
Copy link

I'm getting the same problem on my Samsung Galaxy Note 5. Android version is 7.0 and API level 24. Can anyone solve this problem. I ask for your help.

@mehmetsukrumumbucoglu
Copy link

cc @pichillilorenzo

@manuel-plavsic
Copy link

Unfortunately, the same still happens on Android 13.
I tested it with version 6.0.0-beta.12.

@manuel-plavsic
Copy link

cc @pichillilorenzo

@manuel-plavsic
Copy link

I managed to get it to work. I hadn't thoroughly read the documentation. After setting useShouldOverrideUrlLoading: true inside InAppWebViewSettings, the callback gets called. However, I think you can leave out this setting: if shouldOverrideUrlLoading is set, then useShouldOverrideUrlLoading should be inferred automatically to true in the parts of the plugin where this boolean is needed. Otherwise, shouldOverrideUrlLoading is null (and therefore useShouldOverrideUrlLoading is false). I think that the same applies for onCreateWindow and supportMultipleWindows, and other callback-setting pairs.

@pichillilorenzo
Copy link
Owner

@manuel-plavsic thanks for the idea! I will add this logic in the 6.x.x version.

@pichillilorenzo
Copy link
Owner

@manuel-plavsic Released new version 6.0.0-beta.15 with this "feature":

  • Automatically infer useShouldOverrideUrlLoading, useOnLoadResource, useOnDownloadStart, useShouldInterceptAjaxRequest, useShouldInterceptFetchRequest, useShouldInterceptRequest, useOnRenderProcessGone, useOnNavigationResponse settings if their value is null and the corresponding event is implemented by the WebView (InAppWebView and HeadlessInAppWebView, not InAppBrowser) before it's native initialization

The supportMultipleWindows, differently from the "use..." settings like above, is mapping the native WebView setting on Android (https://developer.android.com/reference/android/webkit/WebSettings#setSupportMultipleWindows(boolean)), so I will leave it as it is.

@manuel-plavsic
Copy link

I tried it, and it works! Thank you for the simpler logic!

Copy link

github-actions bot commented Oct 9, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 9, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants