【发布时间】:2019-10-15 23:23:54
【问题描述】:
如何通过我在 iOS 上的应用程序将图像发送给 whatsapp 上的特定联系人?
Android 提供 Intent 将图像分享给特定联系人,例如:
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.ContactPicker"));
sendIntent.setType("image");
sendIntent.putExtra(Intent.EXTRA_STREAM,uri);
sendIntent.putExtra("jid", PhoneNumberUtils.stripSeparators("919xxxxxxxxx")+"@s.whatsapp.net");
sendIntent.putExtra(Intent.EXTRA_TEXT,"sample text you want to send along with the image");
startActivity(sendIntent);
【问题讨论】:
标签: ios