android – 检查whatsapp在线状态

我被要求创建一个移动应用程序,用于检查所选whatsapp联系人的在线状态,并在所选联系人在线时通知用户.我认为这是可能的,因为它已经存在另一个使用相同信息的应用程序,它至少对某人起作用:

https://play.google.com/store/apps/details?id=com.kiwiio.clonspy

但是我不知道为了获得联系人的whatsapp在线状态我应该查询什么样的软件接口.

有什么样的WhatsApp API我可以用于此目的吗? Android还是IO?或两者?

解决方法:

根据WhatsApp常见问题解答中的这个answer for iPhone developers;

WhatsApp provides two ways for your iPhone app to interact with WhatsApp:

1-)Through a custom URL scheme

2-)Through the iOS Document Interaction API

If your application would like to open a WhatsApp Chat with a specific contact, you can use our custom URL scheme to do so. Opening whatsapp:// followed by one of the following parameters, will open WhatsApp and perform a custom action.

NSURL *whatsappURL = [NSURL URLWithString:@"whatsapp://send?text=Hello%2C%20World!"];
if ([[UIApplication sharedApplication] canOpenURL: whatsappURL]) {
    [[UIApplication sharedApplication] openURL: whatsappURL];
}

在WhatsApp常见问题解答的另一个answer for Android developers上,您可以通过WhatsApp发送一条带有ACTION_SEND意图的消息.您也可以绕过系统选择器,您可以设置sendIntent.setPackage(“com.whatsapp”).对于自定义URL方案:

WhatsApp provides a custom URL scheme to interact with WhatsApp:

If you have a website and want to open a WhatsApp chat with a pre-filled message, you can use our custom URL scheme to do so. Opening whatsapp://send?text= followed by the text to send, will open WhatsApp, allow the user to choose a contact, and pre-fill the input field with the specified text.

Here is an example of how to write this on your website:

<a href="whatsapp://send?text=Hello%20World!">Hello, world!</a>

当时有两个参数是根据iPhone开发人员给出的答案,即app和send.转到第一个链接以查找详细信息.

另请在venomous0x之前查看WhatsAPI库.

相关文章

当我们远离最新的 iOS 16 更新版本时,我们听到了困扰 Apple...
欧版/美版 特别说一下,美版选错了 可能会永久丧失4G,不过只...
一般在接外包的时候, 通常第三方需要安装你的app进行测...
前言为了让更多的人永远记住12月13日,各大厂都在这一天将应...