众所周知,Facebook 的分享意图非常有限,在 facebook 上你只能分享 url,不能分享文字,也不能分享图片,只能分享 url。
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "http://test.com");
sendIntent.setType("text/plain");
startActivity(Intent.createChooser(sendIntent, getResources().getText(R.string.send_to)));
如果你用 facebook 试试这个,它不起作用:
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_STREAM, uriToImage);
shareIntent.setType("image/jpeg");
startActivity(Intent.createChooser(shareIntent, getResources().getText(R.string.send_to)));
但是......我怎么可能在 facebook 上分享我的官方 android 画廊中的图像?
我确信有一种方法可以像官方的 android 画廊一样在 facebook 上分享图像。¿ 如何实现?
PD:我需要在没有 facebook SDK 的情况下这样做,android 库不使用 facebook sdk。