Xcode7的一些修改

昨天 xcode 升級(jí)為7之后,真機(jī)編譯過(guò)不去,模擬器能編譯過(guò),編譯不過(guò),

方法一:更新library使包含Bitcode,否則會(huì)出現(xiàn)以下中的警告;

(null): URGENT: all bitcode will be dropped because ‘/Users/myname/Library/Mobile Documents/comappleCloudDocs/foldername/appname/GoogleMobileAds.framework/GoogleMobileAds(GADSlot+AdEvents.o)‘ was built without bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. Note: This will be an error in the future.
方法二:關(guān)閉Bitcode

工程設(shè)置中 buildingsetting 中搜索bitcode 選擇no

另外 http 支持有問(wèn)題,需要配置支持 http,

方式一: 使用文本編輯Info.plist, 在當(dāng)中添加:


<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
方式二: 在Info.plist中添加:

以上兩種方式所實(shí)現(xiàn)的效果是一致的, 但是并不嚴(yán)謹(jǐn), 建議有選擇的允許HTTP請(qǐng)求(這個(gè)操作方法與上文"方式一"相同):

<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>域名.com</key>
<dict>

<key>NSIncludesSubdomains</key>
<true/>

<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>

<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
</dict>
</dict>
</dict>
當(dāng)然, 以上方法都是建立在所訪問(wèn)的請(qǐng)求是HTTP類(lèi)型的基礎(chǔ)上, 一勞永逸的方法就是讓服務(wù)端升級(jí)使用TLS 1.2 SSL加密請(qǐng)求的HTTPS協(xié)議.

服務(wù)器已支持TLS 1.2 SSL ,但iOS9上還是不行,還要進(jìn)行鏈接里的適配操作?!蹦鞘且?yàn)椋篈TS只信任知名CA頒發(fā)的證書(shū),小公司所使用的 self signed certificate,還是會(huì)被ATS攔截。對(duì)此,建議使用鏈接中給出的NSExceptionDomains,并將你們公司的域名掛在下面。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容