Skip to content

This package makes it super easy to add a one-click share function for social media platforms — hassle-free, with no extra pages or popups. It supports SMS, Instagram, Telegram, WhatsApp, and Snapchat.

License

Notifications You must be signed in to change notification settings

golu7679/react-native-share-with-social-media

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

react-native-share-with-social-media

This package makes it super easy to add a one-click share function for social media platforms — hassle-free, with no extra pages or popups. It supports SMS, Instagram, Telegram, WhatsApp, and Snapchat.

Installation

npm install react-native-share-with-social-media

Important Note for Snapchat

For Snapchat sharing to work, ensure you provide a valid URL. The share functionality requires a properly formatted URL to open the share screen.

Usage

import { open } from 'react-native-share-with-social-media';

// Open a specific app with a message
open('whatsapp', 'This is business')
  .then(() => console.log('Shared successfully'))
  .catch((error) => console.log('Error sharing:', error));

Setup

iOS

cd ios/ && pod install

Add the following to your Info.plist file to enable URL schemes for different social media apps:

<key>LSApplicationQueriesSchemes</key>
<array>
  <string>whatsapp</string>
  <string>instagram</string>
  <string>twitter</string>
  <string>snapchat</string>
  <string>tg</string>
</array>

Android

Add the following queries to your AndroidManifest.xml file inside the <manifest> tag:

<queries>
  <package android:name="com.whatsapp" />
  <package android:name="com.snapchat.android" />
  <package android:name="com.instagram.android" />
  <package android:name="org.telegram.messenger" />
</queries>

Contributing

Support

Encountered an issue or have a question? Feel free to open an issue on GitHub.

Have an idea for a new feature or want to contribute to this project? I'm always open to learning and implementing new things! Open a ticket to discuss your ideas or submit a pull request.

License

MIT


Made with create-react-native-library

About

This package makes it super easy to add a one-click share function for social media platforms — hassle-free, with no extra pages or popups. It supports SMS, Instagram, Telegram, WhatsApp, and Snapchat.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published