Skip to content
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

Using custom URLs within InAppBrowser #42

Closed
alsocalledchris opened this issue Feb 6, 2019 · 6 comments
Closed

Using custom URLs within InAppBrowser #42

alsocalledchris opened this issue Feb 6, 2019 · 6 comments
Labels

Comments

@alsocalledchris
Copy link

Trying to use InAppBrowser and get a URL that redirects to a custom URL (e.g. myapp://gotoThisLink) which if hit using a native browser opens the desired app as expected. However with InAppBrowser the URL fails in onLoadError method with 'unsupported URL' error message. Any ideas how to solve this with InAppBrowser? Thanks

@pichillilorenzo
Copy link
Owner

pichillilorenzo commented Feb 6, 2019

The plugin doesn't have an API for handling custom URL yet (such as WKURLSchemeHandler for iOS)!
However, did you try the shouldOverrideUrlLoading method (with useShouldOverrideUrlLoading option set to true) to capture your custom URL and, then, launch your App? I mean something like:

  @override
  void shouldOverrideUrlLoading(String url) {
    if (url.startsWith("myapp://gotoThisLink")) {
    // launch myapp here
    }
  }

To launch an App, you can use also my other plugin flutter_appavailability using the AppAvailability.launchApp(String uri) method.

@alsocalledchris
Copy link
Author

cool thanks - I will give that a try

@alsocalledchris
Copy link
Author

alsocalledchris commented Feb 10, 2019

@pichillilorenzo tried to get the shouldOverrideUrlLoading working however the method is never called - even with the option useShouldOverrideUrlLoading set as required. Other overridden methods work fine, e.g. onLoadResource - it's just shouldOverrideUrlLoading that seems broken - any ideas?

This is using iOS and latest release v0.5.51.

@alsocalledchris
Copy link
Author

Checking Android and shouldOverrideUrlLoading is working OK.

Copy link

github-actions bot commented Oct 8, 2024

This issue is stale and has been automatically closed because it has been open for more than 365 days with no activity. Please reopen a new issue if you still have it.

@github-actions github-actions bot added the stale label Oct 8, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 8, 2024
Copy link

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 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants