-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMemo
More file actions
45 lines (42 loc) · 1.51 KB
/
Memo
File metadata and controls
45 lines (42 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
参考:http://www.cnblogs.com/loganv/p/4647833.html
https://github.com/ChenYilong/iOS9AdaptationTips
1 从iOS9 Xcode7开始所有http网络请求都默认被替换为https请求,通过如下方式做兼容
a 修改info.plist文件,添加自定义ATS
###允许任意类型数据加载:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
###更加严谨的设置:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<!--指定自己的服务器域名-->
<key>yourserver.com</key>
<dict>
<!--Include to allow subdomains-->
<key>NSIncludesSubdomains</key>
<true/>
<!--Include to allow insecure HTTP requests-->
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<!--Include to specify minimum TLS version-->
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
</dict>
</dict>
</dict>
2 url scheme白名单:
从iOS9开始:app不能直接通过openURL方式打开别的App,解决办法:
a 需将别的App的URL scheme加入到自己的白名单[上限50个]中,如下:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>QQurlscheme</string>
<string>WeiXinurlscheme2</string>
<string>Taobaourlscheme3</string>
<string>Sinaurlscheme4</string>
</array>
***这会带来的问题:一些大型App中不会有巨大的白名单,导致类似淘宝、微信、qq、回调失败!!!
3