在 iOS 应用程序中通过 WhatsApp 共享图像/文本 [英] Share image/text through WhatsApp in an iOS app
本文介绍了在 iOS 应用程序中通过 WhatsApp 共享图像/文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以在 iOS 应用程序中通过 Whatsapp 共享图像、文本或任何您想要的内容?我在谷歌上搜索,但我只找到了关于 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.
现在有一个可用于与 WhatsApp 交互的 API: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屋!
查看全文