Hi,
On iOS 12, [email protected], when I try to login with Google from either firebase or directly through OAuth, my requests are rejected.
As far as I can tell, it's happening because the protocol is ionic:// not https.
Firebase does a client side check of location.protocol and Google OAuth checks for https too.
I can see in the documentation there's no way to change ionic:// back into https/http.
(https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/301).
Is this something that really can't be changed?
Is there a work around I missed?
If not, I reckon this is going to be a major blocker.
You can change it, but not to http or https because they are reserved.
As workaround, there are plugins to do it the native way.
@jcesarmobile
I'm having kind of the same issue, where our feedback script (usabilla) grabs the window.location to submit it as the url value, and we have no control over this script.
issue is, the server returns an error message complaining about the url because the url starts with 'ionic://', could you point me to one of those plugins that would let me change the ionic webview protocol?
btw this happens only on ios
No, you can't change the protocol, what I meant by "the native way" was using native plugins for each case. Usabilla seems to have native SDKs so native way in that case would be a plugin that uses it's native SDK.
The only options I can think of are:
@jcesarmobile so just for my understanding: will Apple not allow setting of the protocol to http / https or file in WkWebView? Or is it an architectural decision by Ionic?
Edit: Now reading here it's an architectural decision by Ionic. Really disappointing :(
The only options to serve local files are:
file:// protocol. There is already the cordova-plugin-wkwebview-engine for that and also it has some problems.file:// protocol problems, acts as a local web server without being a real web server constantly running, but Apple doesn't allow to use http or https as custom scheme.So it's our decision to use the WKURLSchemeHandler, but Apple's decision to not allow to use http or https as scheme value.
Ok, thanks for the clarification!
The only options to serve local files are:
- Use a local web server. This is the only option that allows to use http, but requires a web server constantly running. That is what 2.x version of the plugin does. But it's not a good option and that's why we launched 3.x with the server removed.
- Use
file://protocol. There is already the cordova-plugin-wkwebview-engine for that and also it has some problems.- Use a custom scheme, that's what we did, solves a few of the
file://protocol problems, acts as a local web server without being a real web server constantly running, but Apple doesn't allow to use http or https as custom scheme.So it's our decision to use the
WKURLSchemeHandler, but Apple's decision to not allow to use http or https as scheme value.
is it possible to server remote files with this plugin without using the embedded server?
I mean like
<content src="https://appdomain.com" />
in cordova config.xml ?
Yes, it鈥檚 technically possible, but if you want to use plugins you have to serve the Cordova.js and plugin .js files, and Apple doesn鈥檛 really allow it
thanks, is this plugin honors the content src setting or any other option that we should pass to the plugin to this ?
So any solution on using firebase web (js sdk) and using custom scheme on ios with this plugin? I never receive firebase onAuthStateChange with custom scheme from firebase web
Most helpful comment
So any solution on using firebase web (js sdk) and using custom scheme on ios with this plugin? I never receive firebase onAuthStateChange with custom scheme from firebase web