-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
useShouldOverrideUrlLoading is broken for InAppWebView #146
Comments
Any solutions for this? Having the same issue when I put useShouldOverrideUrlLoading": true in initialOptions. Empty/blank page. Loads fine when I remove that option. I'm trying to find a solution to listen to url changes. Is there a workaround for this plugin? Or is the alternative only in finding/using some other plugin? Cheers |
For now, my bandage solution is listening to the url change inside onLoadStart, seems to fire everytime a diff url has to load. |
@YudiH im using onLoadStart on ios and seems not working, only the first time, Can you show me your code please? |
Try the latest version of the plugin. Also, this plugin changed its name to |
@pichillilorenzo
The |
@ductranit Do you mean at the first load or also when you navigate other links? In the first load, the |
@pichillilorenzo ok, so it isn't called on the first time. |
@ductranit then you can try the
Let me know |
@pichillilorenzo the
|
@pichillilorenzo Updated to that version. But a friend that built on ios reported this problem: CustomeSchemeHandler.swift:22:27: warning: Had to revert back to flutter_inappbrowser 1.2.2 for now |
I have the same issue with federated sign in through Cognito, switching over to https://pub.dev/packages/webview_flutter |
i'm facing the same issue, i'm using the git url in my pubsec.yaml: flutter_inappwebview:
git:
url: https://github.com/pichillilorenzo/flutter_inappwebview It's working fine in debug mode, but in release, the souldOverrideUrlLoading is never triggered on Android. On iOS, it's working fine UpdateUsing controller.getOptions() i can see that, while in debug, options are set correctly but in release mode, every option is equal to null Update 2Found out that shouldOverrideUrlLoading is working correctly unless using in app/build.gradle: buildTypes{
release {
minifyEnabled True
}
} So in the meanwhile, set it to false if anyone is having the same problem as me |
It should work with the new version! Let me know |
Hi I think useShouldOverrideUrlLoading broken again after I updated flutter to stable version 1.22.0. My workaround is use onLoadStart for android platform and shouldOverrideUrlLoading on iOS |
It's broken again |
I'm using version 5.3.2 and it works perfectly |
Can you share your code please? |
I managed to get it working. I was missing something. Thank you for the quick reply. |
I just follow the document, here is my code: shouldOverrideUrlLoading: (controller, navigationAction) async {
final uri = navigationAction.request.url!;
print("uri = " + uri.toString());
if (uri.toString().contains(GameRoute.GAME_COMPLETE)) {
//
return NavigationActionPolicy.CANCEL;
}
return NavigationActionPolicy.ALLOW;
}, |
It's not working for me too in iOS. |
Its broken. why there is none perfect webview plugin in this world? :-( |
Why is this issue closed? It does not work for now |
I solved the problem with this code. InAppWebView(
initialOptions: InAppWebViewGroupOptions(
crossPlatform:
InAppWebViewOptions(useShouldOverrideUrlLoading: true),
),
shouldOverrideUrlLoading: (controller, navigationAction) async {
// any code;
return NavigationActionPolicy.ALLOW;
},
) |
@bakatsuyuki DUDE! you save me a lot of time. Thanks man, i appreciate it, really. |
@kouchi32 : This only works when you are openning any new page. If you come back, it doesn't work |
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. |
On ios: the provided
shouldOverrideUrlLoading
callback is never called.On android: the browser sometimes returns empty pages.
The text was updated successfully, but these errors were encountered: