EddyVerbruggen / Custom-URL-scheme

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

Doesn't work with Cordova Android 9 #336

Closed GabrielCalin closed 2 years ago

GabrielCalin commented 2 years ago

I don't get any error during compilation, but it simply doesn't work. After I upgrade to cordova android 9.0.0 or 9.1.0, the app is not redirected anymore and the browser says unknown scheme. I tried with custom-url-scheme 5.0.0, 5.0.1 and 5.0.2. I'm using Ionic 4 - maybe I should update to Ionic 5? It's really the only thing that I can do that might solve the issue, otherwise I could say for sure that this plugin doesn't work for cordova android 9 (although the release notes for 5.0.0 says it should). After I downgrade to cordova android 8.1.0, it starts working again.

WuglyakBolgoink commented 2 years ago

@GabrielCalin any progress with this error?

GabrielCalin commented 2 years ago

@WuglyakBolgoink unfortunately, not really. I mean, as a workaround, I just updated the target API level to 29 in config.xml, which is what I needed to do in the first place, without upgrading cordova android. Now the custom url scheme works and Google doesn't complain anymore, but from my knowledge for API level 29 it is strongly recommended to update to cordova android 9, so it would be great to be able to do that.

WuglyakBolgoink commented 2 years ago

@GabrielCalin now you must upgrade to cordova-android@10 for supporting android v30 from august on play store!

yesterday I had some problems with navigation , but plugin work fine!

on android browser you can't navigate back to the app without user interaction, I don't understand why, but just do window.location = callbackUrl (as myapp://any_event_name) doesn't work until I did this via html "a"-tag, where user explicit do click. on iOS was no problem with this.

GabrielCalin commented 2 years ago

@WuglyakBolgoink thanks for letting me know about android v30! I guess the issue you mention has something to do with the issue I'm facing. Unfortunately, in my case I can't modify the page where the user is clicking - I am implementing the OAuth flow for Spotify and I'm using my custom scheme as the callback url in the OAuth form. With cordova android 8 everything works well, with 9 it doesn't.

GabrielCalin commented 2 years ago

I found out what the problem was - I was using InAppBrowser and starting with Android 9 we must use '_system' target for OAuth flows. So it was basically an issue with how I was using InAppBrowser, not this plugin. I will close the issue.