iOS,Xcod7/8,iOS使用修改點

來源:互聯網
上載者:User

標籤:

Xcod7使用修改點1.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>

 

2.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

 

3.iOS9安裝企業認證打包的app

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

這是個時候需要iOS9 設定-》通用-》描述檔案-》企業級應用 中信任對應的企業開發人員。

 

4.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加入

<key>LSApplicationQueriesSchemes</key>

<array>

<string>urlscheme</string>

<string>urlscheme2</string>

<string>urlscheme3</string>

<string>urlscheme4</string>

</array>

5.iPad適配Slide Over 和 Split View分屏應用最好把純程式碼改為stroyboard6.部分庫檔案尾碼變更

dylib尾碼的變成tbd

例如:變成

七、Xcode7打相容32位和64位手機機型包

       將build active architecture only改成no,就是32位和64位都包含,會根據不同手機自動選擇使用32還是64.

 

     

Xcode8使用修改點

1.真機調試修改

將所示地方勾選上

 

2.應用許可權配置

在Info.plist中增加如下代碼

<!-- 相簿 -->

<key>NSPhotoLibraryUsageDescription</key>

<string>App需要您的同意,才能訪問相簿</string>

<!-- 相機 -->

<key>NSCameraUsageDescription</key>

<string>App需要您的同意,才能訪問相機</string>

<!-- 麥克風 -->

<key>NSMicrophoneUsageDescription</key>

<string>App需要您的同意,才能訪問麥克風</string>

<!-- 位置 -->

<key>NSLocationUsageDescription</key>

<string>App需要您的同意,才能訪問位置</string>

<!-- 在使用期間訪問位置 -->

<key>NSLocationWhenInUseUsageDescription</key>

<string>App需要您的同意,才能在使用期間訪問位置</string>

<!-- 始終訪問位置 -->

<key>NSLocationAlwaysUsageDescription</key>

<string>App需要您的同意,才能始終訪問位置</string>

<!-- 日曆 -->

<key>NSCalendarsUsageDescription</key>

<string>App需要您的同意,才能訪問日曆</string>

<!-- 提醒事項 -->

<key>NSRemindersUsageDescription</key>

<string>App需要您的同意,才能訪問提醒事項</string>

<!-- 運動與健身 -->

<key>NSMotionUsageDescription</key> <string>App需要您的同意,才能訪問運動與健身</string>

<!-- 健康更新 -->

<key>NSHealthUpdateUsageDescription</key>

<string>App需要您的同意,才能訪問健康更新 </string>

<!-- 健康分享 -->

<key>NSHealthShareUsageDescription</key>

<string>App需要您的同意,才能訪問健康分享</string>

<!-- 藍芽 -->

<key>NSBluetoothPeripheralUsageDescription</key>

<string>App需要您的同意,才能訪問藍芽</string>

<!-- 媒體資料庫 -->

<key>NSAppleMusicUsageDescription</key>

<string>App需要您的同意,才能訪問媒體資料庫</string>

如果不起作用,可以請求後台許可權,類似於這樣:

<key>UIBackgroundModes</key>

<array>

<!-- 在這裡寫上你在後台模式下要使用許可權對應的key -->

<string>location</string>

...

</array>

iOS,Xcod7/8,iOS使用修改點

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.