https://github.com/pierrecapo/react-native-image-to-socials
Share images to social networks
https://github.com/pierrecapo/react-native-image-to-socials
Last synced: 4 months ago
JSON representation
Share images to social networks
- Host: GitHub
- URL: https://github.com/pierrecapo/react-native-image-to-socials
- Owner: PierreCapo
- License: mit
- Created: 2024-12-10T13:59:58.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-30T11:46:24.000Z (over 1 year ago)
- Last Synced: 2025-10-27T15:04:25.448Z (8 months ago)
- Language: Objective-C++
- Size: 2.92 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# react-native-image-to-socials
WIP
Share images to social networks.
New architecture only.
Works on iOS only. Support for Android incoming.
## Installation
```sh
npm install react-native-image-to-socials
```
### iOS
1) In your Info.plist ensures that Instagram is authorized
```XML
LSApplicationQueriesSchemes
instagram
instagram-stories
```
2) 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.
```XML
NSPhotoLibraryUsageDescription
Description string
```
## Usage
### shareToInstagram(imageUri: string)
```js
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)
```js
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](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
## License
MIT
---
Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)