且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

iOS 9没有使用URL SCHEME打开Instagram应用程序

更新时间:2022-04-28 22:22:55

iOS 9对URL方案的处理做了一些小改动。您必须使用 Info.plist 中的 LSApplicationQueriesSchemes 键将您的应用调用的网址列入白名单。

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方法,它将返回否,即使安装了已注册处理此方案的应用程序。将出现此应用程序不允许查询方案xxxsyslog条目。

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方法,它会默默地失败。将出现此应用程序不允许查询方案xxxsyslog条目。

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.