【问题标题】:open instagram post iPhone hook stopped working打开 Instagram 帖子 iPhone 挂钩停止工作
【发布时间】:2018-10-16 21:59:55
【问题描述】:

为了打开带有某些帖子的 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 之后。

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

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

【问题讨论】:

    标签: ios swift instagram instagram-api


    【解决方案1】:

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

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

    【讨论】:

    • 感谢您告诉我,我会密切关注这个错误报告。
    【解决方案2】:

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

    我设法使用 Instagram 网络应用“修复”了 pwa 应用上的问题。

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-07-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多