通过WhatsApp的,从另一个应用程序发送消息到具体的联系 [英] Send message to specific contact through whatsapp from another app

查看:231
本文介绍了通过WhatsApp的,从另一个应用程序发送消息到具体的联系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从另一个应用程序是否可以通过的WhatsApp 来发送消息到一个特定的直接接触?我知道接触式ID。我不想通过意向打开的WhatsApp 。我只想把消息直接发送像正常的短信。

Is it possible to send message to a specific contact through whatsapp directly from another app? I know the contact ID. I don't want to open whatsapp via Intent. I just want to send the message directly like normal sms.

我已经试过张贴在计算器其他的解决方案,但他们不是为我工作。

i have tried other solutions posted on stackoverflow but they are not working for me.

推荐答案

让我知道,如果你的作品,

Let me know if it works for you,

Uri mUri = Uri.parse("smsto:+9876543210");
Intent mIntent = new Intent(Intent.ACTION_SENDTO, mUri);
mIntent.setPackage("com.whatsapp");
mIntent.putExtra("sms_body", "The text goes here");
mIntent.putExtra("chat",true);
startActivity(mIntent);

这篇关于通过WhatsApp的,从另一个应用程序发送消息到具体的联系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆