简体   繁体   English

Instagram - 通过 iOS 应用程序共享图像、文本和 url:swift

[英]Instagram - share image, text and url via iOS app : swift

I am trying to share image with some text and a url from my app to Instagram which would later redirect to iOS app installed on the phone from Instagram app.我正在尝试将图像与一些文本和 url 从我的应用程序共享到 Instagram,该应用程序稍后将重定向到从 Instagram 应用程序安装在手机上的 iOS 应用程序。 I am able to share image on instagram but not with text and url.我可以在 Instagram 上分享图片,但不能通过文字和 url 分享。 Any help related to the same would be great!任何与此相关的帮助都会很棒!

Instagram had removed pushing custom captions to their app while sharing photos at one point, check this post . Instagram取消了将自定义标题推送到其应用程序的功能,同时共享照片, 请查看此帖子

I also understand, according to the Instagram iPhone Hooks page, that you can pass a photo only to the "Select A Filter" Instagram screen, which is before you set a caption. 根据Instagram iPhone Hooks页面,我还了解到,您只能将照片传递到“设置筛选器” Instagram屏幕上,这是在设置标题之前。 I'm sorry, but I don't think Instagram supports custom captions. 对不起,但我不认为Instagram支持自定义字幕。

A Bit Late To Answer (Aug, 2022)回答有点晚(2022 年 8 月)

I have successfully cracked the plain text sharing on Instagram by myself, after doing a lot of research on google on this topic.在google上对这个话题做了很多研究之后,我自己成功破解了Instagram上的纯文本分享。 You can use the mentioned deep link to open Instagram Direct with some text to share from your application,您可以使用提到的深层链接打开 Instagram Direct,其中包含一些要从您的应用程序共享的文本,

instagram://sharesheet?text={AnyTextOrLinkToShare}

Moreover, the below code should work on iOS to launch Instagram Direct (Messenger) from your app with some content此外,下面的代码应该适用于 iOS 从您的应用程序启动 Instagram Direct (Messenger) 并包含一些内容

if let url = URL(string: "instagram://sharesheet?text=https://google.com/") {
   UIApplication.shared.open(url, options: [:], completionHandler: nil)
}

Not sure, why did they hide this information from their official documentation but now who cares, I have achieved it with the continuous efforts of 16-18 hrs: :)不确定,他们为什么要从官方文档中隐藏这些信息,但现在谁在乎,我通过 16-18 小时的持续努力实现了它::)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM