内部导航被拒绝- 未设置url ='mycustomprotocol:// localhost'

问题描述 投票:0回答:1

我正在使用自定义协议为iOS实现cordova应用程序。

通过使用config.xml中的<preference name="iosScheme" value="mycustomprotocol" />通过插件cordova-plugin-ionic-webview设置自定义协议。

我在Xcode中遇到以下错误

ERROR Internal navigation rejected - <allow-navigation> not set for url='mycustomprotocol://localhost'

plugin docs of cordova-plugin-ionic-webview描述允许导航的用法,如下所示

<allow-navigation href="mycustomprotocol://*"/>

我尝试了以下允许导航的值,但是它们似乎都不起作用,并且错误仍然存​​在。

<allow-navigation href="mycustomprotocol:*" />
<allow-navigation href="mycustomprotocol://*" />
<allow-navigation href="mycustomprotocol://*/*" />
<allow-navigation href="mycustomprotocol://localhost" />

我也尝试了通配符<allow-navigation href="*" />,但这不适用于cordova-plugin-whitelist documentation中所述的自定义协议。

cordova ionic-framework cordova-plugins
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.