打开 instagram post iPhone 挂钩停止工作

open instagram post iPhone hook stopped working

为了使用某些 post 打开 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 应用程序打开,但登录提示强制弹出。无论您做什么 - 关闭它或继续登录,查询的 post 都不会打开(参见 gif)。 这是最近开始发生的,在我更新我的应用程序并将部署目标推送到 iOS12 之后。

我确实在我的 LSApplicationQueriesSchemes 中列出了 instagram,而且我 100% 肯定正确的 mediaID 正在传递给 instaOpen func(代码之前有效)。

如果有任何关于如何解决此问题并在 instagram 应用程序中实际打开 instagram post 的建议,请告诉我。

可能是一个错误,因为该功能适用​​于 Android。

我设法 "fix" 使用 Instagram 网络应用程序的 pwa 应用程序上的问题。

let appURL = URL(string: "https://www.instagram.com/p/\(postId)")!
//https://www.instagram.com/p/insert here media id

已更新 - Facebook 开发者修复了该问题。

它的 instagram bug 你可以从 https://developers.facebook.com/support/bugs/290173615155052/?disable_redirect=0

关注它的进展