0

I have implemented sharing to insta stories which are working fine for iOS 12 but not working on iOS 13.

I have tried/verified following points

  • Verified URL Scheme
  • Checked changes to UIPasteBoard
  • Verified asset urls

Everything is as per documentation: 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")
            }
Shahbaz Saleem
  • 317
  • 2
  • 14

2 Answers2

2

I resolved my issue and i was messing in info.plist.

make sure that you have added instagram-stories in LSApplicationQueriesSchemes not in URL Schemes.

Shahbaz Saleem
  • 317
  • 2
  • 14
0

It looks like that "com.instagram.sharedSticker.contentURL" parameter has become unavailable or private.

There is one workaround how you can proceed working with text/url described here: https://stackoverflow.com/a/74241318/20343737

Taras
  • 1,485
  • 1
  • 16
  • 31
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/33056072) – Thomas Smyth - Treliant Nov 03 '22 at 17:07