gpt4 book ai didi

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

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:35:15 25 4
gpt4 key购买 nike

以下网址在 iOS 8.3 及更低版本上打开,但在 iOS 9 上不起作用

let instagramURL = NSURL(string: "instagram://app")

为什么 URL 打不开?

最佳答案

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

请参阅此处的帖子:http://awkwardhare.com/post/121196006730/quick-take-on-ios-9-url-scheme-changes

主要结论是:

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.

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 将在后续版本中修复此问题。

关于iOS 9 不使用 URL SCHEME 打开 Instagram 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31936653/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com