title: Instagram Android Share Intent: Unable to load image
body: <p>I'm facing an issue sending a share intent to Instagram on Android, from the last update from 3 days ago. This is on an Ionic app</p>
  
  <p>I can reproduce the error in the following conditions:</p>
  
  <ul>
  <li>Android >= 8</li>
  <li>Last Instagram Version (133.0.0.32.120)</li>
  <li>Only sharing to Feed, Stories read the image as expected</li>
  </ul>
  
  <p>I will not add the code I'm using to share because seems to be another thing, some change that Instagram introduced in the last update, maybe permissions or something else.</p>
  
  <p>I discard the image path (read/write) because for Stories it's working fine.</p>
  
  <p>Any ideas?
  Thanks.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I'm still try to find a solution. Meanwhile, if you are having the same issue, please leave a comment on this Facebook Bug ticket</p>
  
  <p><a href="https://developers.facebook.com/support/bugs/1326888287510350/" rel="nofollow noreferrer">https://developers.facebook.com/support/bugs/1326888287510350/</a></p>
  
  <p><strong>EDIT 2</strong></p>
  
  <p>This is a workaround solution, I think this is an Instagram bug and should be working again soon, but meanwhile, you can share to Instagram Feed using the <code>MediaStore</code>. I tested this solution on Android 6 to 10.</p>
  
  <pre><code>// Save image to gallery
  String savedImageURL = MediaStore.Images.Media.insertImage(
          getContentResolver(),
          mediaPath,
          "My image",
          "My super image description"
  );
  
  // Parse the gallery image url to uri
  Uri savedImageURI = Uri.parse(savedImageURL);
  
  ClipData clipData = ClipData.newRawUri("Image", savedImageURI);
  
  shareIntent.setClipData(clipData);
  </code></pre>
  
  <p>To make it work correctly, you will need to ask <code>WRITE_EXTERNAL_STORAGE</code> permission, I handled this part on Ionic side</p>