如何在android中以编程方式发送应用程序消息?

时间:2015-03-30 11:31:41

标签: android android-intent android-service whatsapp

我正在尝试实现类似于Pushbullet的功能,即以编程方式回复whats app消息而不进入WhatsApp。

任何帮助将不胜感激,谢谢。

3 个答案:

答案 0 :(得分:2)

查找: https://www.whatsapp.com/faq/android/28000012 什么应用程序没有sdk,所以没有进入什么应用程序,你不能。

答案 1 :(得分:1)

如果没有输入whatsapp联系人chosser屏幕你就无法做到,whatsapp并没有为此提供任何api。

请参阅:WhatsApp Api Integration with Android

但您可以使用此Intent绕过系统应用程序选择器:

Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "My text to send.");
sendIntent.setType("text/plain");
sendIntent.setPackage("com.whatsapp");
startActivity(sendIntent);

答案 2 :(得分:0)

小心:这是非法的 看看图书馆: https://github.com/tgalal/yowsup