Is a custom androidScheme deprecated in Capacitor 6? #7431
-
We're using a custom Is it no longer possible to set a custom |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It's a bug, in Capacitor 6 there is a new javascript injector that requires to provide the url where the javascript execution is allowed, and it's allowed for the app url, i.e. So yeah, something we will need to fix, would be good if you could create an issue and provide a sample app that reproduces the crash. But anyway, you should know that Google engineers discourage using custom schemes on android, they recommend only using https. Custom schemes also cause problems starting in Chrome 117 if using History API |
Beta Was this translation helpful? Give feedback.
It's a bug, in Capacitor 6 there is a new javascript injector that requires to provide the url where the javascript execution is allowed, and it's allowed for the app url, i.e.
https://localhost
, but for google, if using a custom scheme, the hostname should not be included in the url, only the scheme according to this:https://developer.android.com/reference/androidx/webkit/WebViewCompat#addWebMessageListener(android.webkit.WebView,java.lang.String,java.util.Set%3Cjava.lang.String%3E,androidx.webkit.WebViewCompat.WebMessageListener)
So yeah, something we will need to fix, would be good if you could create an issue and provide a sample app that reproduces the crash.
But anyway, you should …