Ios9.0 canOpenURL: failed for URL: "xx" - error:"This app is not allowed to query for scheme xx"
来源:互联网 发布:eclipse可视化编程 编辑:程序博客网 时间:2024/04/29 09:54
如图是在我启动一个 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。
- 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..."
- CodeForces 557B Pasha and Tea
- python废话二:学习python2还是python3
- iOS配置多语言
- LayoutInflater——inflate方法不同参数的区别
- 基于主观颜色模型HSV颜色空间
- Ios9.0 canOpenURL: failed for URL: "xx" - error:"This app is not allowed to query for scheme xx"
- 设计模式读书笔记-----备忘录模式
- LabWindows/CVI线程操作
- android网络交互
- 支持动态Web开发的9个有用&免费工具
- 结构体对齐
- 设计模式读书笔记-----解释器模式
- 微博项目代码勘误
- GDAL2.0编译之添加HDF库编译C#版本