bradmartin / nativescript-advanced-webview

NativeScript plugin for Chrome CustomTabs on Android and SafariViewController on iOS.
Other
60 stars 28 forks source link

Android: OAuth Flow via Schemes doesn't work in the new version #27

Open vtjon opened 6 years ago

vtjon commented 6 years ago

In the latest version (2.0.2), it appears that something broke or changed with regards to redirecting to a custom scheme. I use the webview for an OAuth login flow that redirects to a custom scheme that relaunches the app. When this happens, the browser shows ERR_UNKNOWN_URL_SCHEME. There is some discussion here about a similar issue but it's relatively old: https://github.com/EddyVerbruggen/Custom-URL-scheme/issues/156

I don't have a repo of the issue but there were some errors related to the sandbox. Any ideas what changed in the latest release that could have affected this?

triniwiz commented 6 years ago

@vtjon it opens a webview if if device does not have google chrome installed

vtjon commented 6 years ago

I think I got lazy with my wording. I meant Chrome Custom Tabs for the OAuth login flow. It works again when I go back to version 2.0.0. Chrome is installed. I will say, it does look different though like it defaulted to a webview for some reason (i.e., no URL bar or close X). I just tried to open https://www.google.com and it opens in the Chrome version. It must be switching over to a webview during the redirect cycle.

vtjon commented 6 years ago

It seems like it worked this time. Maybe I had the old AAR file or something. I will reopen if it happens.

vtjon commented 6 years ago

@triniwiz I think I might have figured out what is going on though I'm not sure exactly why. To recap:

I think ultimately, my app is being sent to the background. Upon research, I ran across this: https://stackoverflow.com/a/38494130/62686

I looked at your fancy webview repo and it doesn't appear to call the warmup function. Is this something straightforward to add?

championswimmer commented 6 years ago

I had this similar issue. I set up a fresh webview plugin myself that uses Chrome Custom Tabs. You can try this https://www.npmjs.com/package/nativescript-awesome-webview till the issue is not fixed on this repo

triniwiz commented 6 years ago

@vtjon it should it’s set to true in the init

jdnichollsc commented 5 years ago

@vtjon can you try this other option? https://github.com/proyecto26/nativescript-inappbrowser Let me know 👍