ios - 打开 Instagram 帖子 iPhone 挂钩停止工作
问题描述
为了使用某些帖子打开 Instagram 应用程序,我使用以下代码:
func instaOpen(_ postId: String, _ postUrl: String){
let appURL = URL(string: "instagram://media?id=\(postId)")!
if UIApplication.shared.canOpenURL(appURL) {
UIApplication.shared.open(appURL, options: [:], completionHandler: nil)
} else {
// if Instagram app is not installed, open URL inside Safari
let webURL = URL(string: postUrl)!
let svc = SFSafariViewController(url: webURL)
present(svc, animated: true, completion: nil)
}
}
当调用 instaOpen 函数时——instagram 应用程序打开,但登录提示强制弹出。无论您做什么 - 关闭它或继续登录,查询的帖子根本不会打开(参见 gif)。这种情况最近开始发生,在我更新了我的应用程序并将部署目标推送到 iOS12 之后。
我确实在我的 Instagram 中列出了我LSApplicationQueriesSchemes
的内容,并且我 100% 肯定正确mediaID
的方法正在传递给instaOpen
func(代码以前有效)。
让我知道是否有任何关于如何解决此问题并在 instagram 应用程序中实际打开 instagram 帖子的建议。
解决方案
更新- Facebook 开发人员修复了该问题。
它的 instagram 错误,您可以从https://developers.facebook.com/support/bugs/290173615155052/?disable_redirect=0跟踪其进度
推荐阅读
- reactjs - 带有 React 的事件 onClick - 未调用函数
- java - 大十进制。multiply() 和 divide() 方法返回十六进制数。为什么?
- c# - WebSocketSharp 的最大短信大小是多少?
- special-characters - 如何在 Jabref 中添加连字符或西班牙语单词以在 Lyx 中引用?
- python - 根据另一列的值增加列值
- javascript - 从远程文件夹导入图像的语法是什么?
- linear-programming - GLPK - 上限约束不能正常工作
- python - 允许用户在提交之前编辑或删除 Flask 上上传文件的列表
- android - 添加了多种风味维度,面临 .aar 文件生成问题
- wsl-2 - 如何在 WSL 2 上运行 Gitk?