EddyVerbruggen / Custom-URL-scheme

:link: Launch your Cordova/PhoneGap app by a Custom URL scheme like mycoolapp://
1.03k stars 367 forks source link

Redirect to custom scheme restarts the app on older Androids #269

Open dcxn opened 6 years ago

dcxn commented 6 years ago

I started using this nice plugin recently together with the safari webview controller for the Oauth flow in my cordova app. After a user logs in in our Oauth Server, which we open in the Safari Webview Browser, we redirect to the custom scheme to trigger the handleOpenURL callback and pass the URL with the auth_code into it. On older android versions, like 5 and 6, this step triggers a restart of the app, where a new instance is created on top of the old, prompting splash screen into the entry point of the app which is very inconvenient.

We have found out via other issues we can fix this by setting the AndroidLaunchMode preference to singleTask, but this is not recommended by the Android documentation and may have hidden side effects we don't even know about.

Are there other ways to circumvent these app restarts everytime our users log in?

cadesalaberry commented 6 years ago

I would love to know more about this as well.