Ios9.0 canOpenURL: failed for URL: "xx" - error:"This app is not allowed to query for scheme xx"
来源:互联网 发布:苹果软件无法联网 编辑:程序博客网 时间:2024/05/16 05:50
如图是在我启动一个 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 网址引发的控制台报错信息
<code class="xml"><span class="hljs-tag" style="color: rgb(0, 102, 102);"><<span class="hljs-title" style="color: rgb(0, 0, 136);">key</span>></span>NSAppTransportSecurity<span class="hljs-tag" style="color: rgb(0, 102, 102);"></<span class="hljs-title" style="color: rgb(0, 0, 136);">key</span>></span><span class="hljs-tag" style="color: rgb(0, 102, 102);"><<span class="hljs-title" style="color: rgb(0, 0, 136);">dict</span>></span><span class="hljs-comment" style="color: rgb(136, 0, 0);"><!--Include to allow all connections (DANGER)--></span><span class="hljs-tag" style="color: rgb(0, 102, 102);"><<span class="hljs-title" style="color: rgb(0, 0, 136);">key</span>></span>NSAllowsArbitraryLoads<span class="hljs-tag" style="color: rgb(0, 102, 102);"></<span class="hljs-title" style="color: rgb(0, 0, 136);">key</span>></span><span class="hljs-tag" style="color: rgb(0, 102, 102);"><<span class="hljs-title" style="color: rgb(0, 0, 136);">true</span>/></span><span class="hljs-tag" style="color: rgb(0, 102, 102);"></<span class="hljs-title" style="color: rgb(0, 0, 136);">dict</span>></span></code>
如之前所说,Apple 希望我们访问相对安全的 HTTPS,所以在你需要访问 HTTP 时,
虽 Apple 不建议,但可通过在 Info.plist 中声明如上图所示的内容,倒退回不安全的网络请求,这样依然能让 App 访问指定 HTTP,甚至任意的 HTTP。
- 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: "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"
- 【iOS开发】-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里
- "This app is not allowed to query for scheme ***"
- iOS社会化分享报错:- error: "This app is not allowed to query for scheme mqq"
- canOpenURL: failed for URL: "xx"
- 调用app出现"This app is not allowed to query for scheme..."
- 加快C++代码的编译速度方法
- Fiddler 教程
- bzoj 3098 Hash Killer II 生日悖论
- eclipse选中变量的时候不能凸显
- js的两种调试方法
- Ios9.0 canOpenURL: failed for URL: "xx" - error:"This app is not allowed to query for scheme xx"
- Jmeter性能测试 入门
- 文件拷贝以及sock的基本使用(基于PO学校网络课)笔记
- 并发式IO的解决方案
- HTTP协议
- HTTP协议 (二) 基本认证
- 第五周-三色球问题
- HTTP协议 (三) 压缩
- HTTP协议 (四) 缓存