由于不安全,App Transport Security阻止了明文HTTP(http://)资源加载. [英] App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure.

查看:1350
本文介绍了由于不安全,App Transport Security阻止了明文HTTP(http://)资源加载.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据说可以通过应用程序的Info.plist文件配置临时异常. 在其他答案之后,我将此条目添加到了info.plist中,但无济于事(更糟糕的是,当我更改xml文件后,尝试在iPhone而非模拟器上运行该应用程序时出现权限错误-但是那是一个不同的问题.)

Supposedly temporary exceptions can be configured via your app's Info.plist file. Following other answers, I added this entry to the info.plist but it does not help (even worse, after I changed the xml file I get a permission error when I attempt to run the app on my iPhone but not on the simulator - but that is a different problem.)

 <key>NSAppTransportSecurity</key>
 <dict>
 <key>NSAllowsArbitraryLoads</key>
  <true/>
 </dict>

推荐答案

从Project Navigator中,单击您的项目名称.

From Project Navigator click your project's name.

现在,在右侧,您将看到项目的常规"选项卡. 选择信息",然后在海关iOS目标属性"中添加新类型.

Now, on the right side you' ll see the General Tab of your project. Select the Info and in the Customs iOS Target Properties add a new type.

将其命名为NSAppTransportSecurity,键入Dictionary. 在其中添加一个新项并将其命名为NSAllowsArbitraryLoads,键入为Boolean,值为YES.

Name it as NSAppTransportSecurity, type as Dictionary. Inside that add a new item and name it as NSAllowsArbitraryLoads, type as Boolean, value YES.

希望能解决您的问题.

这篇关于由于不安全,App Transport Security阻止了明文HTTP(http://)资源加载.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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