xcode7,ios9 部分兼容設置


內容來源廣大的互聯網

神奇的蘋果公司,再一次讓程序員中槍。

一、xcode7 新建的項目,Foundation下默認所有http請求都被改為https請求.

HTTP+SSL/TLS+TCP = HTTPS

也就是說,服務需要提供https(TLS 1.2)的接口;

如果服務不改變,則客戶端info.plist的根<dict>需加下面的鍵值;

簡單信任所有http服務器
<key>NSAppTransportSecurity</key> <dict> <!--Connect to anything (this is probably BAD)--> <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>

二、xcode7 默認開啟,bitcode(iwatch需要),則會導致部分第三方框架報錯(比如友盟的錯誤)

youmeng/libMobClickLibrary.a(MobClick.o)' does not contain 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. for architecture armv7

這是要么更新庫,要么可以在 build setting 中,搜索bitcode,並吧 enable bitcode 設置為 NO

 

三、iOS9安裝企業證書打包的app

企業證書打包的app,安裝到手機里面后第一次打開app。不會像以前提示,信任還是不信任該證書;

這是個時候需要iOS9 設置-》通用-》描述文件-》企業級應用 中信任對應的企業開發者。

 

四、iOS9 URL Schemes 

除了要在項目info URL Types中設置URL Schemes,還需要在info.plist里面增加可信任的調用app,否則回報如下錯誤

-canOpenURL: failed for URL: "weixin://app/wx9c8771d3c07dfd30/" - error: "This app is not allowed to query for scheme weixin"

-canOpenURL: failed for URL: "wtloginmqq2://qzapp" - error: "This app is not allowed to query for scheme wtloginmqq2"

info.plist加入(QQ跟微信的schemes)

<key>LSApplicationQueriesSchemes</key>

<array>
<string>mqqbrowser</string>
<string>mqq</string>
<string>mqqapi</string>
<string>mqqopensdkapiV2</string>
<string>weixin</string>
<string>wechat</string>
<string>tencent</string>
<string>QQ</string>
<string>wtloginmqq2</string>
<string>mqqopensdkapiV3</string>
<string>mqqopensdkapiV2</string>
<string>mqqwpa</string>
<string>mqqOpensdkSSoLogin</string>
<string>mqq</string>
<string>mqzoneopensdkapiV2</string>
<string>mqzoneopensdkapi19</string>
<string>mqzoneopensdkapi</string>
<string>mqzoneopensdk</string>
<string>mqzone</string>
<string>wtloginmqq2</string>
<string>mqqopensdkapiV3</string>
<string>mqqwpa</string>
<string>mqqopensdkapiV2</string>
<string>mqqOpensdkSSoLogin</string>
<string>openmobileqq</string>
</array>

 

五、iPad適配Slide Over 和 Split View

分屏應用最好把純代碼改為stroyboard

 

 

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM