iOS 9 无法使用 URL SCHEME 打开 Instagram 应用 [英] iOS 9 not opening Instagram app with URL SCHEME

查看:30
本文介绍了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 应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆