Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sharing text with image to instagram using android intent

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?

like image 984
ammcom Avatar asked Sep 17 '15 22:09

ammcom


People also ask

How to share image with text on Instagram in Android programmatically?

Intent shareIntent = new Intent(Intent. ACTION_SEND); shareIntent. setType("image/*"); shareIntent.

Can we share text on Instagram?

Instagram app for Android and iPhoneTap or in the top right of Feed. Tap in the top right. Select people you'd like to send a message to, then tap Chat. Type a message.

How do you share photos on Instagram Android?

Instagram app for AndroidTo upload a photo from your phone's library, select the photo you'd like to share. To take a new photo, tap above Camera. You can tap to switch between front and rear-facing cameras and to adjust flash. Tap , then add a caption or your location.


2 Answers

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:

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.

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"));

I'm sorry to say that it simply isn't possible, and we're at the discretion of Facebook in making this decision.

like image 63
Paul Lammertsma Avatar answered Oct 13 '22 20:10

Paul Lammertsma


Until it`s not solved by Instagram, I copy the text to the clipboard and instruct the user to paste it

like image 7
Ricardo Schaffer Avatar answered Oct 13 '22 20:10

Ricardo Schaffer