react-native-image-to-socials
v0.3.0
Published
Share images to social networks
Readme
react-native-image-to-socials
WIP Share images to social networks. New architecture only. Works on iOS only. Support for Android incoming.
Installation
npm install react-native-image-to-socialsiOS
- 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
shareToInstagramneeds to save the image in the Photo Library before being able to forward it to Instagram.
<key>NSPhotoLibraryUsageDescription</key>
<string>Description string</string>Usage
shareToInstagram(imageUri: 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);shareToInstagramStory(appId: string, imageUri: string, backgroundImageUri?: string)
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);Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
Made with create-react-native-library
