我用谷歌搜索,并得到一些解决方案,似乎唯一可行的方法是通过UIDocumentInteractionController.我找到了只能共享文本的结果,也找到了仅共享图像的结果.
但我要的是份额BOTH.
我知道这个问题可能会重复,我只想说清楚,这是截图...

(这是从Android共享的)
我在我的应用程序中有一个共享按钮,我想同时共享图像和文本.Gmail中工作正常,但在WhatsApp的,只有图像被发送和Facebook的应用程序崩溃.
我使用共享代码是这样的:
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("image/*");
shareIntent.putExtra(Intent.EXTRA_TEXT, "Message");
Uri uri = Uri.parse("android.resource://" + getPackageName() + "/drawable/ford_focus_2014");
try {
InputStream stream = getContentResolver().openInputStream(uri);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
Run Code Online (Sandbox Code Playgroud)
如果我使用"shareIntent.setType("*/*")"Facebook和WhatsApp崩溃.
有办法做到这一点吗?也许同时发送两条消息(WhatsApp).
提前致谢.
我正在使用UIDocumentInteractionController方法将我的应用程序中的图像共享到WhatsApp(在如何从我的应用程序发送图像到WhatsApp中进行了解释?,WhatsApp图像共享iOS).
我也知道通过URI选项的共享,用于仅共享文本(在此解释:https://www.whatsapp.com/faq/iphone/23559013).
有没有办法在一个共享中共享图像和标题?