如何使用URL方案修复iOS 13中的'分享到instagram故事的问题

问题描述 投票:0回答:1

我已经实现了与insta故事的共享,这些故事在iOS 12上运行正常,但在iOS 13上却无法运行。

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

  • 已验证的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个回答
1
投票
© www.soinside.com 2019 - 2024. All rights reserved.