首页 > 解决方案 > 打开 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的方法正在传递给instaOpenfunc(代码以前有效)。

问题

让我知道是否有任何关于如何解决此问题并在 instagram 应用程序中实际打开 instagram 帖子的建议。

标签: iosswiftinstagraminstagram-api

解决方案


更新- Facebook 开发人员修复了该问题。

它的 instagram 错误,您可以从https://developers.facebook.com/support/bugs/290173615155052/?disable_redirect=0跟踪其进度


推荐阅读