Cordova-plugin-ionic-webview: WKPort on Android

Created on 14 Oct 2018  路  8Comments  路  Source: ionic-team/cordova-plugin-ionic-webview

I changed the WKPort like mentioned on the README.md to a random number. I think that should be removed for the Android Section. If I do this for the Android platform, Cordova platform will never be ready. So you will never use Cordova Plguins

The root cause is: gap_init called from restricted origin

Most helpful comment

In case it helps anyone we managed to figure it out as something like:

<preference name="Hostname" value="localhost:8100" />
<allow-navigation href="http://localhost:8100/*" />
<allow-navigation href="https://localhost:8100/*" />

All 8 comments

Working ok for me, do you also have an allow-navigation element with the revised port number?

We should potentially rename it to be ionic-webview-port or something as the wk prefix is from when it was iOS only.

Working ok for me, do you also have an allow-navigation element with the revised port number?

@graemeenglish Could you please share this line of your xml-file?

<preference name="WKPort" value="8081" />
<allow-navigation href="http://localhost:8081/*" />

Thank you very much! This is working :) Without <allow-navigation href="http://localhost:XXXX/*" /> it wouldn't working, but with it is. Think that has to be added to the documentation!

Totally agree on this one.
Maybe a Pull request @paulstelzer ?

WKPort is gone.
You can still put it as part of the new Hostname preference, and now it's documented that if you change Hostname value you'll have to add an allow-navigation entry for the new value to make it work on Android

Closing this issue.

In case it helps anyone we managed to figure it out as something like:

<preference name="Hostname" value="localhost:8100" />
<allow-navigation href="http://localhost:8100/*" />
<allow-navigation href="https://localhost:8100/*" />
Was this page helpful?
0 / 5 - 0 ratings

Related issues

begbeder picture begbeder  路  5Comments

pschinis picture pschinis  路  4Comments

50l3r picture 50l3r  路  7Comments

jamesdixon picture jamesdixon  路  4Comments

acollazomayer picture acollazomayer  路  3Comments