WIP Share images to social networks. New architecture only. Works on iOS only. Support for Android incoming.
npm install react-native-image-to-socials
- In your Info.plist ensures that Instagram is authorized
<key>LSApplicationQueriesSchemes</key>
<array>
<string>instagram</string>
<string>instagram-stories</string>
</array>
- In your Info.plist ensures that NSPhotoLibraryUsageDescription is set up.
It is used because the function
shareToInstagram
needs to save the image in the Photo Library before being able to forward it to Instagram.
<key>NSPhotoLibraryUsageDescription</key>
<string>Description string</string>
import { shareToInstagram } from 'react-native-image-to-socials';
// This opens directly instagram and prompt to use it either as a
// imageUri is local. Check example/App.tsx as an example.
await shareToInstagram(imageUri);
import { shareToInstagramStory } from 'react-native-image-to-socials';
// imageUri is local. Check example/App.tsx as an example.
// your appId found in Meta. This opens directly a story post
await shareToInstagramStory(appId, imageUri);
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library