gpt4 book ai didi

ios - 使用 url 方案直接将图像分享到 WhatsApp

转载 作者:行者123 更新时间:2023-11-30 11:08:55 24 4
gpt4 key购买 nike

我想在我的应用中集成 WhatsApp 共享,但我不想使用 UIDocumentInteractionController。有没有办法使用 url schema 共享图像?就像我们使用下面的代码使用 url 方案共享文本一样

var whatsappURL:NSURL?= NSURL(string: "whatsapp://send?text=Hello%2C%20World!")
if (UIApplication.shared.canOpenURL(whatsappURL)) {
UIApplication.shared.openURL(whatsappURL)
}

最佳答案

我认为你做不到。

首先,Whatapps 仅支持通过 URLScheme 发送文本。其次,如何将图像放入 urlString 中?将其转换为base64字符串?

您只能使用 UIDocumentInteractionController 发送图像

关于ios - 使用 url 方案直接将图像分享到 WhatsApp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52399203/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com