内部导航已拒绝:< allow-navigation not set>在iOS上的Cordova [英] Internal navigation rejected: <allow-navigation not set> in Cordova on iOS

查看:2881
本文介绍了内部导航已拒绝:< allow-navigation not set>在iOS上的Cordova的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用Cordova构建了一个iOS应用程序。该应用尝试加载网页,例如 http://yourdomain.com/home 在index.html中。但是,该网页保持空白,并在控制台中出现错误内部导航被拒绝 - < allow-navigation>未针对url =' http:// yourdomain设置。 com / home



我已经设置了< access origin =http://yourdomain.com/home subdomains =true/> ,并尝试通过设置< allow-navigation> 标记。但页面保持空白。我缺少什么吗?请指导。



在index.html中添加以下元标记后,内部导航错误已消失,但页面仍为空白。 :(

 < meta http-equiv =Content-Security-Policycontent =default-src * src'self''unsafe-inline'; script src:'self''unsafe-inline''unsafe-eval'> 


解决方案

我有这个问题,结果有两个config.xml文件。第一个是在Xcode,但你必须编辑第二个



AppName / platform / ios / AppName / config.xml



我添加了

 < allow-navigation href =* /> 


I have built an iOS app using Cordova. The app tries to load a web page e.g. http://yourdomain.com/home in index.html. But, the page stays white blank with error in console "Internal navigation rejected - <allow-navigation> not set for url='http://yourdomain.com/home'".

I have already set <access origin="http://yourdomain.com/home" subdomains="true" /> and also tried by setting <allow-navigation> tag. But the page stays blank. am I missing anything else? Please guide.

After adding the following meta tag in index.html, the "internal navigation error" has gone, but the page is still white blank. :(

<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script src: 'self' 'unsafe-inline' 'unsafe-eval'">

解决方案

I was having this problem and it turns out there are two config.xml files. The first one is in Xcode, but you have to edit the second one from the filesystem.

AppName/config.xml

AppName/platforms/ios/AppName/config.xml

I added

<allow-navigation href="*" /> 

to both of them and it worked. Using 6.3.0.

这篇关于内部导航已拒绝:&lt; allow-navigation not set&gt;在iOS上的Cordova的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆