简体   繁体   English

使用url方案直接将图像共享到WhatsApp

[英]Share image to WhatsApp directly using url scheme

I want to integrate WhatsApp sharing in my app but I don't want to use UIDocumentInteractionController . 我想将WhatsApp共享集成到我的应用程序中,但是我不想使用UIDocumentInteractionController Is there any way to share image using url scheme ? 有没有办法使用url scheme共享图像? like we share text using url scheme using following code below 就像我们使用以下代码使用url方案共享文本

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

I think you can't do it. 我想你做不到。

Firstly, the Whatapps only support send text via URLScheme . 首先,Whatapps仅支持通过URLScheme发送文本。 Secondly, how you can put your image in the urlString? 其次,如何将图像放入urlString中? Convert it to base64string? 将其转换为base64string?

You can only send image by using UIDocumentInteractionController 您只能使用UIDocumentInteractionController发送图像

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

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