在iOS应用程序中通过WhatsApp共享图像/文本 [英] Share image/text through WhatsApp in an iOS app
问题描述
是否可以通过Whatsapp在iOS应用中分享图片,文字或其他任何内容?我在google上搜索,但我只发现了有关Android实现的结果。
Is it possible to share images, text or whatever you want through Whatsapp in a iOS app? I'm searching on google but I only found results talking about Android implementations.
提前致谢!
推荐答案
不,这是不可能的,whatsapp没有任何可以使用的公共API。
No this is not possible, whatsapp does not have any public API you can use.
请注意这个答案对于2011年没有WhatsApp的API是正确的。
现在有一个api可用于与WhatsApp进行交互:< a href =http://www.whatsapp.com/faq/en/iphone/23559013 =noreferrer> http://www.whatsapp.com/faq/en/iphone/23559013
Now there is an api available for interacting with WhatsApp: http://www.whatsapp.com/faq/en/iphone/23559013
打开其中一个URL的Objective-C调用如下:
The Objective-C call to open one of these URLs is as follows:
NSURL *whatsappURL = [NSURL URLWithString:@"whatsapp://send?text=Hello%2C%20World!"];
if ([[UIApplication sharedApplication] canOpenURL: whatsappURL]) {
[[UIApplication sharedApplication] openURL: whatsappURL];
}
这篇关于在iOS应用程序中通过WhatsApp共享图像/文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!