适配ios9出现的问题:-canOpenURL: failed for URL
除了要在项目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>
最好的方法是直接看官方文档,看一下配置
-
支持http协议
(1)暂时回退到http协议 info plist加
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
(2)添加指定域名为http白名单
2 涉及到客户端跳转 设置scheme到LSApplicationQueriesSchemes
总结:像此类问题 使用第三方的直接看别人官网就行了 要不访问提供方的如微信,QQ,支付宝API官方看开发文档
如果是用sharesdk 友盟此类的 去看他们的开发文档都会第一时间给开发者提供解决方案的
sharesdk分享 iOS9适配文档地址
http://wiki.mob.com/ios9-%E5%AF%B9sharesdk%E7%9A%84%E5%BD%B1%E5%93%8D%EF%BC%88%E9%80%82%E9%85%8Dios-9%E5%BF%85%E8%AF%BB%EF%BC%89/
友盟分享 iOS9适配地址
http://dev.umeng.com/social/ios/ios9