Flutter Ios支持http请求数据配置

发布于 5 年前 作者 phonegap100 4105 次浏览 来自 分享

Xcode7以上版本出现获取网络请求时出现如下异常

App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app’s Info.plist file.

意思就是: App Transport Security (应用程序传输安全)阻止了一个明文HTTP传输,因为它是不安全的,配置你的Info.plist 可以临时例外(就是可以通过)

Flutter Ios支持http请求数据配置方法:

1、在Info.plist中添加 NSAppTransportSecurity,按回车自动改变成App Transport Security Settings,类型 Dictionary ; 2、在 NSAppTransportSecurity 下添加 NSAllowsArbitraryLoads 按回车自动改变成Allow Arbitrary Loads,类型Boolean ,值设为 YES; 等价于 1 在Info.plist中直接添加App Transport Security Settings, 类型 Dictionary 2 在 NSAppTransportSecurity下直接添加Allow Arbitrary Loads, 类型Boolean ,值设为 YES;

1.png

回到顶部