【iOS开发】-canOpenURL: failed for URL: "xx" - error:"This app is not allowed to query for scheme xx"
来源:互联网 发布:aps审核 知乎 编辑:程序博客网 时间:2024/05/15 23:49
如图是在我启动一个 Xcode 7 + iOS 9 的 App 之后,控制台的输出。
这在 Xcode 6.4 + iOS 8 时,是不会有的情况,原因是【为了强制增强数据访问安全, iOS9 默认会把所有从NSURLConnection
、 CFURL
、 NSURLSession
发出的 HTTP 请求,都改为 HTTPS 请求:iOS9.x-SDK编译时,默认会让所有从NSURLConnection
、 CFURL
、 NSURLSession
发出的 HTTP 请求统一采用 TLS 1.2(SSL 3.1) 协议。】
下面说解决方案:
①如果你的输出信息是-canOpenURL: failed for URL: "kindle://home" - error: "This app is not allowed to query for scheme kindle"
去你的 target 里面的 Build Settings 下的 Enable Bitcode,把它设置成 NO,这不一定会阻挡你的控制台继续输出这条信息,但是可以保证你的 App 正常运行。
②如果你的输出信息是 xxxx - error: "This app is not allowed to query for scheme xxxx"
(在这里因为我的 App 集成了分享到QQ、微信、微博的功能,xxxx部分我看到了 mqq、wechat、sinaweibosso 等多条信息)
去 Info.plist 里面建立一个叫 LSApplicationQueriesSchemes 的 Array,把你在xxxx部分看到的词汇一个一个填进去,直至控制台没有任何相关输出即可。
③关于其他通过 WebView 访问 http 网址引发的控制台报错信息
<key>NSAppTransportSecurity</key><dict><!--Include to allow all connections (DANGER)--><key>NSAllowsArbitraryLoads</key><true/></dict>
如之前所说,Apple 希望我们访问相对安全的 HTTPS,所以在你需要访问 HTTP 时,
虽 Apple 不建议,但可通过在 Info.plist 中声明如上图所示的内容,倒退回不安全的网络请求,这样依然能让 App 访问指定 HTTP,甚至任意的 HTTP。
- 【iOS开发】-canOpenURL: failed for URL: "xx" - error:"This app is not allowed to query for scheme xx"
- -canOpenURL: failed for URL: "xx" - error:"This app is not allowed to query for scheme xx"
- canOpenURL: failed for URL: "xx" - error:"This app is not allowed to query for scheme xx"
- [iOS]canOpenURL: failed for URL: "xx" - error:"This app is not allowed to query for scheme xx"
- Ios9.0 canOpenURL: failed for URL: "xx" - error:"This app is not allowed to query for scheme xx"
- iOS9.0 canOpenURL: failed for URL: "xx" - error:"This app is not allowed to query for scheme xx"key>
- iOS9.0 canOpenURL: failed for URL: "xx" - error:"This app is not allowed to query for scheme xx"
- Ios9.0 canOpenURL: failed for URL: "xx" - error:"This app is not allowed to query for scheme xx"
- Ios9.0 canOpenURL: failed for URL: "xx" - error:"This app is not allowed to query for scheme xx"
- -canOpenURL: failed for URL: "wechat://" - error: "This app is not allowed to query for scheme wech
- iOS分享授权问题:-canOpenURL: failed ..."This app is not allowed to query for sscheme xx
- -canOpenURL: failed for URL: "kindle://home" - error: "This app is not allowed to query for scheme k
- -canOpenURL: failed for URL: "weixin://app/wxff569f1617559XX1/" - error: "This app is not allowed to
- iOS 9 failed for URL: "XXX://@" - error: "This app is not allowed to query for scheme XXX" iOS 从APP里
- iOS社会化分享报错:- error: "This app is not allowed to query for scheme mqq"
- "This app is not allowed to query for scheme ***"
- canOpenURL: failed for URL: "xx"
- iOS应用之间跳转 报错:"This app is not allowed to query for scheme ***"
- 二、Ubuntu12.04和14.04安装ssh和vnc远程桌面
- Linux中整理代码工具indent的使用
- Spring定时任务异常
- 【VS开发】获取CPU tick tick 周期
- 深入分析Java的序列化与反序列化
- 【iOS开发】-canOpenURL: failed for URL: "xx" - error:"This app is not allowed to query for scheme xx"
- Core Animation - 第一次使用图层来创建一个简单的项目
- HTTP基本原理(浏览器缓存)
- Ajax学习(3)数据格式提要
- NOIP 2009 最优贸易
- 82. Remove Duplicates from Sorted List II
- uva673 Parentheses Balance
- boost::io_service 的使用 & 如何检查网络通讯正常?心跳包机制 or Detection of Half-Open (Dropped) Connections
- 回调思想和钩子函数的区别