Cordova-ios 6.1.0 how to use WKURLSchemeHandler

Viewed 1054

I have cordova project that I was able to build and deploy till now I switchted to cordova-ios 6.1.0. I guess it's related to WKWebView support.

I tried to build and deploy app to similator. Build says OK, deploying works and my index.html is served, but nothting more. Nothing happends. I enabled Safari dev mode and connected to simulator but no logs there :(

From official releasea notes I can read about WKURLSchemeHandler: https://cordova.apache.org/announcements/2020/06/01/cordova-ios-release-6.0.0.html

Do I have to used scheme and hostname preferences? What does it change if I set it to 'app' and 'localhost' respectively? Do I have to change anything in app's code?

It stopped working and for the first time I don't know where to look for problems.

From logs I can read:

Could not signal service com.app.WebKit.WebConent:113 : Could not find specified service

Could not signal service com.app.WebKit.Networking:113 : Could not find specified service

Any idea how to proceed?

1 Answers

I used this same code on config.xml:

<preference name="scheme" value="app" />
<preference name="hostname" value="localhost" />

Another thing, but I need to enable CORS on server side, but if you can't change anything in the server (my case) you can enable this plugin from oracle:

cordova plugin add cordova-plugin-wkwebview-file-xhr

Say me if this help you?

Related