使用Android Intent将图像与文本共享到Instagram [英] Sharing text with image to instagram using android intent
问题描述
我知道这个问题已经问过几次了,我正在尝试使用发送意图将标题添加到共享到instagram的图像上
I know that this question has been asked several times before, I am trying to add caption to image shared to instagram using send intent
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("image/*");
shareIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
shareIntent.putExtra(Intent.EXTRA_STREAM,uri);
shareIntent.putExtra(Intent.EXTRA_TEXT,"YOUR TEXT TO SHARE IN INSTAGRAM");
shareIntent.setPackage("com.instagram.android");
return shareIntent;
有人设法使它起作用吗?
Has someone ever managed to make it work?
不支持该支持或该支持被撤消了吗?
Is it not supported or has the support been revoked?
推荐答案
Instagram有官方声明(2015年中),宣布iOS和Android应用将不再接受预填充的字幕:
There was an official statement from Instagram (mid-2015) announcing that pre-populated captions would no longer be accepted in the iOS and Android apps:
从今天开始,iOS Hooks和Android Intent将停止接受第三方应用传递的字幕.这是一项不间断的更改:利用预填充字幕的现有移动应用将继续能够使用此流程通过Instagram应用共享媒体,但现在Instagram将忽略字幕文本.若要为第三方应用程序共享的照片或视频创建标题,用户必须手动输入标题,就像使用Instagram本地应用程序共享内容时一样.
Beginning today, the iOS Hooks and Android Intents will stop accepting captions passed by third party apps. This is a non-breaking change: existing mobile apps that utilize pre-filled captions will continue to be able to use this flow to share media through the Instagram apps, but now Instagram will ignore the caption text. To create a caption for a photo or video shared by a third party app, users will have to enter a caption manually, the same way they already do when sharing content using the Instagram native apps.
看看适用于Android的Instagram文档,的确,我们看到了并没有像其他应用程序习惯那样在意图中额外提供常规的 Intent.EXTRA_TEXT
字符串.他们的示例仅限于提供Uri:
Looking at the Instagram documentation for Android, indeed we see that there's no mention of providing the conventional Intent.EXTRA_TEXT
string extra in the intent as is customary for other apps. Their sample is limited to only providing a Uri:
// Add the URI to the Intent.
share.putExtra(Intent.EXTRA_STREAM, uri);
// Broadcast the Intent.
startActivity(Intent.createChooser(share, "Share to"));
很遗憾地说,这根本不可能,而且我们在Facebook的决定下自行决定.
I'm sorry to say that it simply isn't possible, and we're at the discretion of Facebook in making this decision.
这篇关于使用Android Intent将图像与文本共享到Instagram的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!