我想知道如何将文本发送到特定的whatsapp联系人。我找到了一些查看特定联系人的代码,但没有发送数据。
Cursor c = getContentResolver().query(ContactsContract.Data.CONTENT_URI,
new String[] { ContactsContract.Contacts.Data._ID }, ContactsContract.Data.DATA1 + "=?",
new String[] { id }, null);
c.moveToFirst();
Intent i = new Intent(In
我正在尝试从我的应用程序发送pdf文件到whatsapp,这里是代码,但缺少一些东西!
它打开whatsapp,我可以选择一个联系人,但它显示“共享失败”!
代码
String PLACEHOLDER = "file:///android_asset/QUOT_2016_10(test).pdf";
File f = new File(PLACEHOLDER);
Uri uri = Uri.fromFile(f);
Intent share = new Intent();
share.setAction(Intent.ACTION_SEND);
share.putExtra(
我需要在我的HTML中添加一个深度链接,以便在电话中添加一个联系人,然后在whatsapp中开始一个新的对话。
我找到了这个密码
<a href="whatsapp://send?text=Hello%2C%20World!">Send text to whatsapp</a>
而这个:
<a href="whatsapp://send?abid=username&text=Hello%2C%20World!">Send text to user</a>
即使我没有具体的联系人,我也需要与一个特定的联系人进
如何通过单击应用程序中的按钮打开与特定联系人的Whatsapp聊天?
这就是我使用的代码。它打开WhatsApp,让我搜索我想要发送消息的联系人,但它不会打开我提供给它的特定联系人号码的WhatsApp聊天。
whatsappButton.setOnClickListener{
var con = itemView.context
val textToShare = "*כח אדם*"
val phoneNumber = blogPost.phone
val se
我想从一个角度的网站发送到WhatsApp的图像。
我知道如何通过创建一个带有href的锚点将文本消息发送到WhatsApp,如下所示;
<a href="https://api.whatsapp.com/send?text=Hi, this is a test" target="_blank">Send by WhatsApp</a>
但我不知道如何将相同或相似的图片从我的Angular网站发送到WhatsApp。
我怎样才能做到这一点呢?
我想知道如何向特定的whatsapp联系人发送文本和图像。我找到了一些代码来查看特定的联系人,但不是发送数据。
Uri uri = Uri.parse("smsto:" + smsNumber);
Intent i = new Intent(Intent.ACTION_SENDTO, uri);
i.putExtra("sms_body", smsText);
i.setPackage("com.whatsapp");
startActivity(i);
但该代码只是打开聊天历史记录,而不是获取文本和图像并发送它。
我也尝试了下面的代码,
如何通过我在iOS上的应用程序向whatsapp上的特定联系人发送图像?
Android提供了将图片分享给特定联系人的意图,例如:
Intent sendIntent = new Intent("android.intent.action.SEND");
File f=new File("path to the file");
Uri uri = Uri.fromFile(f);
sendIntent.setComponent(new ComponentName("com.whatsapp","com.whatsapp.ContactPi
我的意图是通过whatsapp通过我的application.What发送一个PDF文件,现在它没有打开whatsapp appliation.Below是我的代码:
Uri uri = Uri.fromFile(pdfFile);
Intent share = new Intent(Intent.ACTION_SEND);
//share.setAction(Intent.ACTION_SEND);
share.setType("application/pd
我正在开发一个安卓应用程序,我需要向WhatsApp的具体联系人发送一条信息。我试过这个代码:
Uri mUri = Uri.parse("smsto:+999999999");
Intent mIntent = new Intent(Intent.ACTION_SENDTO, mUri);
mIntent.setPackage("com.whatsapp");
mIntent.putExtra("sms_body", "The text goes here");
mIntent.putExtra("chat",t