官方说的比较详细,但是就是有些重复,而且有很多坑
坑1、集成后,打开app发现一堆问题(如下)
**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传输安全
发布的iOS9系统上围绕用户数据的安全性和体验新增了一些安全特性
以iOS9 SDK编译的工程会默认以SSL安全协议进行网络传输,即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,用第三方登录,发现没有sso授权页面,或打开QQ失败、微信失败、微博失败等
解决办法:
info.plist增加:
Paste_Image.png Paste_Image.png这个可以到:http://dev.umeng.com/social/ios/ios9#2
原因:
在iOS9下就需要增加一个可跳转的白名单,指定对应跳转App的URL Scheme,否则将在第三方平台判断是否跳转时用到的canOpenURL时返回NO,进而只进行webview授权或授权/分享失败。
网友评论