標籤:div 實踐 oci www blog .com shu pre exception
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 //Twitter33 <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>
iOS 9/10強制使用https訪問網路,使用了第三方SDK的應用需要配置的資訊