Shareing image to Instagram using Expo

Hey guys,
I’m struggling to find a way to share an image(saved on disk or through URL) to Instagram.

For IOS, the solution can be found at

How do I share the image to Instagram?

I tried to use IntentLauncherAndroid. but no luck,

IntentLauncherAndroid.startActivityAsync("android.intent.action.SEND", { uri: "${localpath}" }, "");

I get the following warning with the above line
[Unhandled promise rejection: Error: No Activity found to handle Intent { act=android.intent.action.SEND (has extras) }]

Also, through Linking, I can open the Instagram app by calling (But not share image)


The Native Solution for this is

React Native Plugins available (I have not tried it as it is not expo)

1 Like


IntentLauncherAndroid is missing the ability to call setType and setPackage.

On Android the API would look like this:

Intent intent = getPackageManager().getLaunchIntentForPackage("");
Intent shareIntent = new Intent(Intent.ACTION_SEND);
try {
  shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(MediaStore.Images.Media.insertImage(getContentResolver(), imagePath, "I am Happy", "Share happy !")));
} catch (FileNotFoundException e) {

If you want to open a PR I can work through it with you. Not sure the best solution for this given that ReactNative.Share & ReactNative.Linking both drop the ball on this.
It would be nice to unify the process across platforms rather than to use IntentLauncherAndroid.

1 Like

Yea, that would be a great idea.
Eagerly waiting for a solution.

I could provide whatever help you need for the PR

I am from the same team as @ragularuban I wrote the below-overloaded method to support this. I have patched the class IntentLauncherModule.

  public void startActivity(String activity, @Nullable ReadableMap data, Promise promise, String type, String packageName) {
    if (pendingPromise != null) {
      pendingPromise.reject("ERR_INTERRUPTED", "A new activity was started");
      pendingPromise = null;

    if (activity == null || activity.isEmpty()) {
      promise.reject("ERR_EMPTY_ACTIVITY", "Specified activity was empty");

    try {
      Activity currentActivity = getCurrentActivity();
      Intent intent = new Intent(activity);

      if (data != null) {

      if(packageName != null){
      if(type != null){

      if (currentActivity != null) {
      } else {

      pendingPromise = promise;
    } catch (Exception e) {
      promise.reject("ERR_LAUNCHING_ACTIVITY", e);

  public void startActivity(String activity, @Nullable ReadableMap data, Promise promise) {
    startActivity(activity, data, promise, null, null);

Shall I submit a PR for this? Also if the PR gets merged - do we have to wait till the next release comes out? Or can we use the master branch for our builds?


1 Like

You should definitely make a PR and ask for this to get merged.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.