【问题标题】:Internal navigation rejected - <allow-navigation> not set for url='mycustomprotocol://localhost'内部导航被拒绝 - <allow-navigation> 未设置为 url='mycustomprotocol://localhost'
【发布时间】:2020-04-04 17:16:36
【问题描述】:

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

自定义协议是通过 config.xml 中的 &lt;preference name="iosScheme" value="mycustomprotocol" /&gt; 使用插件 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" />

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

【问题讨论】:

    标签: cordova ionic-framework cordova-plugins


    【解决方案1】:

    使用&lt;allow-navigation href="*://*" /&gt;修复它

    【讨论】:

      猜你喜欢
      • 2018-07-26
      • 2016-07-14
      • 1970-01-01
      • 2013-08-28
      • 2018-01-10
      • 2010-09-14
      • 2012-08-12
      • 2019-04-30
      • 2016-10-17
      相关资源
      最近更新 更多