iOS 9 not opening Instagram app with URL SCHEME(iOS 9 无法使用 URL SCHEME 打开 Instagram 应用)
问题描述
以下 URL 在 iOS 8.3 及更低版本上打开,但在 iOS 9 上不起作用
The following URL opens on iOS 8.3 and lower, but it does not work and iOS 9
let instagramURL = NSURL(string: "instagram://app")
为什么网址打不开?
推荐答案
iOS 9 对 URL 方案的处理做了一个小改动.您必须将您的应用使用 Info.plist 中的 LSApplicationQueriesSchemes 键调用的 url 列入白名单.
iOS 9 has made a small change to the handling of URL scheme. You must whitelist the url's that your app will call out to using the LSApplicationQueriesSchemes key in your Info.plist.
请在此处查看帖子:http:///awkwardhare.com/post/121196006730/quick-take-on-ios-9-url-scheme-changes
主要结论是:
如果您对不在白名单中的 URL 调用canOpenURL"方法,即使安装了已注册处理此方案的应用程序,它也会返回NO".将出现此应用不允许查询方案 xxx"的 syslog 条目.
If you call the "canOpenURL" method on a URL that is not in your whitelist, it will return "NO", even if there is an app installed that has registered to handle this scheme. A "This app is not allowed to query for scheme xxx" syslog entry will appear.
如果您对不在白名单中的 URL 调用openURL"方法,它将静默失败.将出现此应用不允许查询方案 xxx"的 syslog 条目.
If you call the "openURL" method on a URL that is not in your whitelist, it will fail silently. A "This app is not allowed to query for scheme xxx" syslog entry will appear.
作者还推测这是操作系统的错误,Apple 将在后续版本中修复此问题.
The author also speculates that this is a bug with the OS and Apple will fix this in a subsequent release.
这篇关于iOS 9 无法使用 URL SCHEME 打开 Instagram 应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:iOS 9 无法使用 URL SCHEME 打开 Instagram 应用
基础教程推荐
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
