Share your image with the Instagram app using Intents
(iOS & Android)
$ yarn add @micabe/react-native-share-instagram
$ react-native link @micabe/react-native-share-instagram
import RNReactNativeSharingWinstagram from 'react-native-sharing-winstagram';
RNReactNativeSharingWinstagram.shareWithInstagram(this.state.fileName, this.state.base64EncodedImageString, message => {
if (message) alert(message)
}, error => {
alert(error.message) // error callback for IOs only
})
- Make sure you have authorised in
Info.plist
your app to communicate with the Instagram app (iOS):
<key>LSApplicationQueriesSchemes</key>
<array>
<string>instagram</string>
</array>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app requires access to the photo library to share on Instagram.</string>
- You can use the react-native-fetch-blob library to download your remote image and convert it to
.base64()
- Test library to work with windows OS