Ionic app for Android fails after sign-in redirect with url scheme error

Viewed 194

I'm developing an Ionic/Cordova/Angular app in Visual Studio Code targeted for Android API 30. Its MSAL sign-in process has a redirect URI that is set up in Azure, let's say it's myapp://callback. Android 11+ devices won't allow it, throwing a ERR_UNKNOWN_URL_SCHEME error. So, under the impression that I need to use http or https, after I changed myapp://callback to https://localhost/callback, I keep getting ERR_CONNECTION_REFUSED. I've tried intents and permissions in the manifest file, but they don't seem to do anything. I've tried plugins, and I get "plugin not installed" errors, even though they were installed/added. What am I missing?

1 Answers

It turns out that I needed to upgrade cordova-plugin-safariviewcontroller to 2.0.0 and add a CustomTabsService intent to config.xml as documented on this page: https://github.com/auth0/auth0-cordova/issues/180

I also needed to add cordova-plugin-androidx-adapter and this setting to config.xml,

as well as add the following script to package.json: "postinstall": "npx jetify"

Related