使用url方案直接将图像分享给WhatsApp

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

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

var whatsappURL:NSURL?= NSURL(string: "whatsapp://send?text=Hello%2C%20World!")
if (UIApplication.shared.canOpenURL(whatsappURL)) {    
        UIApplication.shared.openURL(whatsappURL) 
    }
ios swift whatsapp url-scheme whatsapi
1个回答
0
投票

我想你做不到。

首先,Whatapps只支持通过qazxsw poi发送文本。其次,如何将图像放入url String中?将其转换为base64字符串?

您只能使用URLScheme发送图像

© www.soinside.com 2019 - 2024. All rights reserved.