My Ionic Info
“@capacitor/cli”: “^3.4.3”,
I’m implementing oauth2 on an Ionic React app for Android but when receive the callback with the code and status, the webview shows an ERR_NAME_NOT_RESOLVED.
In the capacitor config.json I forze https for the app:
"server": {
"iosScheme": "ionic",
"androidScheme": "https",
"hostname": "com.gronze.maps",
....
In the android manifest I use an intent filter
<intent-filter>
<data android:scheme="@string/custom_url_scheme"/>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
</intent-filter>
and in the strings.xml I use the custom_url_scheme
<string name="custom_url_scheme">com.gronze.maps</string>
When calls to the mydomain/oauth2/authorize with the oauth params, my server sends the callback
https://com.gronze.maps/?code=&state=m8882
but the app shows a blanck page with the ERR_NAME_NOT_RESOLVED.

But if I reload the webview with this url, the app works fine again.
What is happening? it fails on callback but works if reload
If instead of com.gronze.maps I use localhost, and the callback received is https://localhost/?code=&state=m8882 the page shows an ERR_CON_REFUSED and if I try to reload it works again
Thanks!
Jorge
1 post - 1 participant