title: React Native sharing image to Instagram from DocumentDirectoryPath
body: <p>I have made custom native module for React Native that's need to share images from path <code>/data/user/0/com.instagramscheduler/files/downloaded.jpg</code> (that is my application) and to be clear <strong>file exists in that folder</strong>. </p>
  
  <p>But the problem is that it is not sharing, when I share to Instagram it says that it is <strong>unable to load file</strong>. I have checked and <code>uri.toString() == "file:///data/user/0/com.instagramscheduler/files/downloaded.jpg"</code></p>
  
  <p>My React Native custom share method: </p>
  
  <pre><code>public void share() {
      // Create the new Intent using the 'Send' action.
      Intent share = new Intent(Intent.ACTION_SEND);
  
      // Set the MIME type
      share.setType("image/jpeg");
      share.setPackage("com.instagram.android");
  
      // Create the URI from the media
      File media = new File("/data/user/0/com.instagramscheduler/files/downloaded.jpg");
      Uri uri = Uri.fromFile(media);
  
      // Add the URI to the Intent.
      share.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
      share.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
      share.putExtra(Intent.EXTRA_STREAM, uri);
  
      // Broadcast the Intent.
      activity.startActivity(Intent.createChooser(share, "Share To"));
  }
  </code></pre>
  
  <p>Here is my <strong>manifest</strong> if it helps:</p>
  
  <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.instagramscheduler"&gt;
  
  &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  
  &lt;application
    android:allowBackup="true"
    android:label="@string/app_name"
    android:icon="@mipmap/ic_launcher"
    android:theme="@style/AppTheme"&gt;
    &lt;activity
      android:name=".MainActivity"
      android:label="@string/app_name"
      android:screenOrientation="portrait"
      android:configChanges="keyboard|keyboardHidden|orientation|screenSize"&gt;
      &lt;intent-filter&gt;
          &lt;action android:name="android.intent.action.MAIN" /&gt;
          &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
      &lt;/intent-filter&gt;
    &lt;/activity&gt;
    &lt;activity android:name="com.facebook.react.devsupport.DevSettingsActivity" /&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p></p>
  
  <p>Here is <strong>logcat</strong> if needed (starting from when share dialog open till it fails to share on Instagram): <a href="https://gist.github.com/Azael05x/f706925668ce9b8dd9970a81ed23e979" rel="nofollow">https://gist.github.com/Azael05x/f706925668ce9b8dd9970a81ed23e979</a></p>