iOS 9/10强制使用https访问网络,使用了第三方SDK的应用需要配置的信息

2017年01月01日起苹果将全面禁止使用http来访问网络。

网上扒了一些资源,解决方法还是有的,但是都不确定是否可以通过审核,毕竟实践才是检验真理的唯一标准。

后续如果上线成功,再来分享。

如果应用中使用了shareSDK,请参考(这里)。

如果应用中添加了友盟分享,请参考(这里)。

当然还有大神进行的比较全面的阐述,请参考(这里)。

总结一下,解决方案是:给项目的.plist文件增加配置信息,配置内容如下:给NSAppTransportSecurity字典增加以下内容

 1 <dict>
 2         <key>NSExceptionDomains</key>
 3         <dict>
 4             //Facebook
 5             <key>akamaihd.net</key>
 6             <dict>
 7                 <key>NSExceptionAllowsInsecureHTTPLoads</key>
 8                 <true/>
 9                 <key>NSExceptionRequiresForwardSecrecy</key>
10                 <false/>
11                 <key>NSIncludesSubdomains</key>
12                 <true/>
13             </dict>
14             <key>fbcdn.net</key>
15             <dict>
16                 <key>NSExceptionAllowsInsecureHTTPLoads</key>
17                 <true/>
18                 <key>NSExceptionRequiresForwardSecrecy</key>
19                 <false/>
20                 <key>NSIncludesSubdomains</key>
21                 <true/>
22             </dict>
23             <key>facebook.com</key>
24             <dict>
25                 <key>NSExceptionAllowsInsecureHTTPLoads</key>
26                 <true/>
27                 <key>NSExceptionRequiresForwardSecrecy</key>
28                 <false/>
29                 <key>NSIncludesSubdomains</key>
30                 <true/>
31             </dict>
32             //Twitter
33             <key>twitter.com</key>
34             <dict>
35                 <key>NSExceptionAllowsInsecureHTTPLoads</key>
36                 <true/>
37                 <key>NSExceptionRequiresForwardSecrecy</key>
38                 <string>NO</string>
39                 <key>NSIncludesSubdomains</key>
40                 <true/>
41             </dict>
42             //新浪
43             <key>sina.com.cn</key>
44             <dict>
45                 <key>NSExceptionMinimumTLSVersion</key>
46                 <string>TLSv1.0</string>
47                 <key>NSExceptionAllowsInsecureHTTPLoads</key>
48                 <true/>
49                 <key>NSExceptionRequiresForwardSecrecy</key>
50                 <false/>
51                 <key>NSIncludesSubdomains</key>
52                 <true/>
53             </dict>
54             <key>weibo.cn</key>
55             <dict>
56                 <key>NSExceptionMinimumTLSVersion</key>
57                 <string>TLSv1.0</string>
58                 <key>NSExceptionAllowsInsecureHTTPLoads</key>
59                 <true/>
60                 <key>NSExceptionRequiresForwardSecrecy</key>
61                 <false/>
62                 <key>NSIncludesSubdomains</key>
63                 <true/>
64             </dict>
65             <key>weibo.com</key>
66             <dict>
67                 <key>NSExceptionMinimumTLSVersion</key>
68                 <string>TLSv1.0</string>
69                 <key>NSExceptionAllowsInsecureHTTPLoads</key>
70                 <true/>
71                 <key>NSExceptionRequiresForwardSecrecy</key>
72                 <false/>
73                 <key>NSIncludesSubdomains</key>
74                 <true/>
75             </dict>
76             //qq,微信
77             <key>qq.com</key>
78             <dict>
79                 <key>NSExceptionAllowsInsecureHTTPLoads</key>
80                 <true/>
81                 <key>NSExceptionRequiresForwardSecrecy</key>
82                 <false/>
83                 <key>NSIncludesSubdomains</key>
84                 <true/>
85             </dict>
86         </dict>
87     </dict>        
原文地址:https://www.cnblogs.com/PaulpauL/p/6187425.html