iOS9請求https問題-記錄

來源:互聯網
上載者:User

標籤:

  iOS9 開始蘋果將HTTP全改為HTTPS了,所以出現網路請求失敗問題,解決辦法:

1、改回HTTP:

    在info.plist檔案中添加一個Key:NSAppTransportSecurity(字典類型),然後給它添加一個Key:NSAllowsArbitraryLoads(Boolean型),屬性值設為YES.如:
      
2、添加白名單

   (這裡主要針對運行程式列印‘-canOpenURL: failed for URL: "XXX" - error: "This app is not allowed to query for scheme XXX"’問題)(以友盟為例吧)

    將info.plist檔案以Source Code方式開啟,在裡面添加類似下面的代碼(一般官網上可找到處理辦法的,http://dev.umeng.com/social/ios/ios9)

<key>LSApplicationQueriesSchemes</key>    <array>        <string>wechat</string>        <string>weixin</string>        <string>sinaweibohd</string>        <string>sinaweibo</string>        <string>sinaweibosso</string>        <string>weibosdk</string>        <string>weibosdk2.5</string>    </array>

 3、之後運行程式,列印資訊會變為‘-canOpenURL: failed for URL: "XXX" - error: "null"’,此列印貌似無法消除(我沒有找到方法解決,不過真機時不會出現次列印)

到此OK.

 

添加友情連結,關於iOS9適配問題:http://www.cocoachina.com/ios/20150702/12384.html

iOS9請求https問題-記錄

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.