I am trying to make sharing from my app to Instagram easy. And what I want is to get to the screen that is depicted on the screenshot below. I've tried instagram-stories://share deeplink and I've read thorugh all these docs: https://developers.facebook.com/docs/instagram/sharing-to-stories/
However, whatever I do, when the url scheme action fires it goes directly into sharing the image into the story. What am I missing here?
Here is my code excerpt:
if let image = image {
guard let urlScheme = URL(string: "instagram-stories://share"),
let imageData = image.pngData() else {
return
}
if UIApplication.shared.canOpenURL(urlScheme) {
let pasterboardItems = [["com.instagram.sharedSticker.backgroundImage": imageData]]
let pasterboardOptions = [UIPasteboard.OptionsKey.expirationDate: Date().addingTimeInterval(60*5)]
UIPasteboard.general.setItems(pasterboardItems, options: pasterboardOptions)
UIApplication.shared.open(urlScheme, options: [:], completionHandler: nil)
}
}