gpt4 book ai didi

android - 查看whatsapp在线状态

转载 作者:可可西里 更新时间:2023-11-01 05:40:46 40 4
gpt4 key购买 nike

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

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

但是我不知道应该查询什么样的软件界面才能获得联系人的whatsapp在线状态。

是否有任何类型的 WhatsApp API 可用于该目的?安卓还是IO?还是两者兼而有之?

最佳答案

根据这个answer for iPhone developers在 WhatsApp 常见问题上;

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];
}

在另一个answer for Android developers在 WhatsApp FAQ 上,您可以使用 ACTION_SEND Intent 通过 WhatsApp 发送消息。也可以绕过系统选择器,可以设置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开发者的回答,当时有两个参数,分别是appsend。转到第一个链接以查找详细信息。

同时检查 WhatsAPI图书馆 venomous0x .

关于android - 查看whatsapp在线状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28714495/

40 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com