【问题标题】:How to fix 'sharing to instagram stories' in iOS 13 using URL Scheme如何使用 URL Scheme 在 iOS 13 中修复“分享到 Instagram 故事”
【发布时间】:2019-10-11 07:56:48
【问题描述】:

我已经实现了分享到在 iOS 12 上运行良好但在 iOS 13 上运行良好的 insta 故事。

我已经尝试/验证了以下几点

  • 经过验证的 URL 方案
  • 检查 UIPasteBoard 的更改
  • 经过验证的资产网址

一切都按照文档:https://developers.facebook.com/docs/instagram/sharing-to-stories/

if schemeAvailable(scheme: "instagram-stories://share"){
                let pasteboardItems = ["com.instagram.sharedSticker.backgroundImage":UIImagePNGRepresentation(postImage!)!,
                                       "com.instagram.sharedSticker.contentURL":"http://google.com"] as [String : Any]
                UIPasteboard.general.setItems([pasteboardItems])
                UIApplication.shared.open(URL(string: "instagram-stories://share")!, options: [:], completionHandler: { (finished) in
                    print("")
                })
            }else{
                print("Can't open URL")
            }

【问题讨论】:

    标签: ios swift instagram-api url-scheme uipasteboard


    【解决方案1】:

    我解决了我的问题,但我在 info.plist 中搞砸了。

    确保您已将instagram-stories 添加到LSApplicationQueriesSchemes 而不是URL Schemes

    【讨论】:

      猜你喜欢
      • 2019-04-06
      • 2022-12-30
      • 2021-03-06
      • 2021-09-26
      • 1970-01-01
      • 1970-01-01
      • 2019-11-24
      • 2019-11-08
      • 2022-11-11
      相关资源
      最近更新 更多