An open API service indexing awesome lists of open source software.

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

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);
```
drawing

### 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);
```

drawing

## 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)