官方說的比較詳細段审,但是就是有些重復,而且有很多坑
坑1、集成后,打開app發(fā)現(xiàn)一堆問題(如下)
**2016-02-02 10:43:48.978 MShow[778:259789] -canOpenURL: failed for URL: "weixin://app/wxd19e67a9eed31d47/" - error: "This app is not allowed to query for scheme weixin"**
**2016-02-02 10:43:48.989 MShow[778:259789] -canOpenURL: failed for URL: "wtloginmqq2://qzapp" - error: "This app is not allowed to query for scheme wtloginmqq2"**
**2016-02-02 10:43:48.990 MShow[778:259789] -canOpenURL: failed for URL: "mqqopensdkapiV3://qzapp" - error: "This app is not allowed to query for scheme mqqopensdkapiV3"**
**2016-02-02 10:43:48.992 MShow[778:259789] -canOpenURL: failed for URL: "mqqwpa://qzapp" - error: "This app is not allowed to query for scheme mqqwpa"**
**2016-02-02 10:43:48.993 MShow[778:259789] -canOpenURL: failed for URL: "mqqopensdkapiV2://qzapp" - error: "This app is not allowed to query for scheme mqqopensdkapiV2"**
**2016-02-02 10:43:48.995 MShow[778:259789] -canOpenURL: failed for URL: "mqqOpensdkSSoLogin://qqapp" - error: "This app is not allowed to query for scheme mqqOpensdkSSoLogin"**
**2016-02-02 10:43:48.996 MShow[778:259789] -canOpenURL: failed for URL: "mqq://qqapp" - error: "This app is not allowed to query for scheme mqq"**
**2016-02-02 10:43:48.997 MShow[778:259789] -canOpenURL: failed for URL: "mqzoneopensdkapiV2://qzapp" - error: "This app is not allowed to query for scheme mqzoneopensdkapiV2"**
**2016-02-02 10:43:48.998 MShow[778:259789] -canOpenURL: failed for URL: "mqzoneopensdkapi19://qzapp" - error: "This app is not allowed to query for scheme mqzoneopensdkapi19"**
**2016-02-02 10:43:49.000 MShow[778:259789] -canOpenURL: failed for URL: "mqzoneopensdkapi://qzapp" - error: "This app is not allowed to query for scheme mqzoneopensdkapi"**
**2016-02-02 10:43:49.001 MShow[778:259789] -canOpenURL: failed for URL: "mqzoneopensdk://qzapp" - error: "This app is not allowed to query for scheme mqzoneopensdk"**
解決辦法:
在info.plist中加入安全域名白名單(右鍵info.plist用source code打開)
這個可以到:http://dev.umeng.com/social/ios/ios9#2
原因:
- HTTP傳輸安全
發(fā)布的iOS9系統(tǒng)上圍繞用戶數(shù)據(jù)的安全性和體驗新增了一些安全特性
以iOS9 SDK編譯的工程會默認以SSL安全協(xié)議進行網(wǎng)絡傳輸捐下,即HTTPS
在info.plist的NSAppTransportSecurity下新增NSAllowsArbitraryLoads并設置為YES,指定所有HTTP連接都可正常請求 http://dev.umeng.com/social/ios/ios9
// 推出iOS9之后,看到http請求就應該知道+這個
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
坑2、集成第三方登錄后
打開app,用第三方登錄窍育,發(fā)現(xiàn)沒有sso授權頁面恕齐,或打開QQ失敗、微信失敗显歧、微博失敗等
解決辦法:
info.plist增加:
這個可以到:http://dev.umeng.com/social/ios/ios9#2
原因:
在iOS9下就需要增加一個可跳轉的白名單仪或,指定對應跳轉App的URL Scheme,否則將在第三方平臺判斷是否跳轉時用到的canOpenURL時返回NO士骤,進而只進行webview授權或授權/分享失敗范删。