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

net: ERR_UNKNOWN_URL_SCHEME with targetSdkVersion 30 #338

Open
3 tasks done
benmesza opened this issue Oct 6, 2021 · 5 comments
Open
3 tasks done

net: ERR_UNKNOWN_URL_SCHEME with targetSdkVersion 30 #338

benmesza opened this issue Oct 6, 2021 · 5 comments

Comments

@benmesza
Copy link

benmesza commented Oct 6, 2021

Bug Report

Problem

Use auth0 in Ionic cordova app, and when user sign in to app successfully cannot redirect to app because net: ERR_UNKNOWN_URL_SCHEME error. targetSdkVersion 29 was worked, but when upgrade to 30 get this error on Android 11 platform, but works on Android 10.

What is expected to happen?

Successfully redirect to app on Android 11

What does actually happen?

Get net: ERR_UNKNOWN_URL_SCHEME error.

Information

Command or Code

Auth0 integration

Environment, Platform, Device

Android 11

Version information

Cordova CLI: 10.0.0
Cordova platform: Cordova-Android 10.1.1
Frameworks: Ionic 5 with Angular 12.1.0

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@Heimo001
Copy link

Heimo001 commented Nov 3, 2021

Hi benmesza,

we had the same issue, but thanks to the Ionic_AppAuth demos we solved it.
https://github.com/wi3land/ionic-appauth/tree/master/demos/angular-cordova

Just update cordova-plugin-inappbrowser with this command:
ionic cordova plugin add https://github.com/Onegini/cordova-plugin-inappbrowser.git

Best regards,
Heimo

@brassier
Copy link

brassier commented Nov 5, 2021

We're having a similar issue. @Heimo001 - I'm not quite following why your suggested fix would address this custom url scheme issue. Can you explain how the fix addresses the problem?

@Heimo001
Copy link

Heimo001 commented Nov 5, 2021 via email

@alexneats
Copy link

I checked this out.

The old repo works because it's doing a 'cordova.getActivity().startActivity(intent)', whereas the modern one tries to do a callbackContext.sendPluginResult(result) with the custom URL scheme, if the AllowedSchemes platform preference is specified.
But even doing that doesn't get my app around the issue.

I stumbled onto this issue\pull request for cordova-plugin-safariviewcontroller v2.0.1: https://github.com/EddyVerbruggen/cordova-plugin-safariviewcontroller/pull/180/files

Until that gets merged\released, adding this to my AndroidManifest.xml gets my app around the issue:
<queries> <intent> <action android:name="android.support.customtabs.action.CustomTabsService" /> </intent> </queries>

@Fourie-r
Copy link

This is still an issue for us as well.
Using:
[email protected]
on device with Android 11 targeting SDK 31 works with the fix from @Heimo001

works on 'Android 9' with InAppBrowser v5.0.0.
Trying to implement Auth0 with cordova and angular.
Regards, Ivan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants