Share photo to instagram

#1

I’m trying to share a photo to Instagram with the following code:

Linking.openUrl(‘instagram://app’);

This will open the Instagram app, but I need to have Instagram open with my photo in its filter screen. There is documentation on how to do this with Objective-C, but not with React-Native.

Here is the link: https://www.instagram.com/developer/mobile-sharing/iphone-hooks/

The explanation points to native code. How do I did it in JavaScript?

Document Interaction
If your application creates photos and you’d like your users to share these photos using Instagram, you can use the Document Interaction API to open your photo in Instagram’s sharing flow.

You must first save your file in PNG or JPEG (preferred) format and use the filename extension “.ig”. Using the iOS Document Interaction APIs you can trigger the photo to be opened by Instagram. The Identifier for our Document Interaction UTI is com.instagram.photo, and it conforms to the public/jpeg and public/png UTIs. See the Apple documentation articles: Previewing and Opening Files and the UIDocumentInteractionController Class Reference for more information.

Alternatively, if you want to show only Instagram in the application list (instead of Instagram plus any other public/jpeg-conforming apps) you can specify the extension class igo, which is of type com.instagram.exclusivegram.

When triggered, Instagram will immediately present the user with our filter screen. The image is preloaded and sized appropriately for Instagram. For best results, Instagram prefers opening a JPEG that is 640px by 640px square. If the image is larger, it will be resized dynamically.

#2

answered this on stackoverflow: https://stackoverflow.com/questions/44600245/share-photo-to-instagram-from-react-native-app-built-with-expo-sdk/44600809#44600809

1 Like
#4

Hey guys,
The code provided solves for IOS :heavy_check_mark:️.

I’m struggling to find a sollutiin for Android.

Hope somebody could show some light on this :sleepy:

#5

Please subscribe to this canny for updates https://expo.canny.io/feature-requests/p/make-it-possible-to-share-an-image-to-instagram-on-ios-and-android

x-post: Shareing image to Instagram using Expo