New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-native-share-modal

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-share-modal

TODO

0.2.10
latest
Source
npm
Version published
Weekly downloads
17
-61.36%
Maintainers
1
Weekly downloads
 
Created
Source

React Native Share Modal

Build Status

A bottomsheet modal that offers sharing between multiple mainstream social media applications.

Peer Dependencies

This packages depends on the below packages to function properly:

Installation

Install the dependencies at the root of your React Native project

$ npm install --save react-native-share-modal

Additional Configurations

iOS

To enable facebook's sharing functionality you'll have to first setup and register your app on Facebook's Developer console following this guide https://developers.facebook.com/docs/sharing/ios/

In your Info.plist file in your Project.xcworkspace/Project.xcodeproj add the below block of code:-

<key>LSApplicationQueriesSchemes</key>
<array>
	<string>whatsapp</string>
	<string>fb-messenger</string>
	<string>tg</string>
	<string>mailto</string>
	<string>message</string>
	<string>twitter</string>
	<string>fb</string>
	<string>fb-messenger-share-api</string>
	<string>fbauth2</string>
	<string>fbapi</string>
	<string>fbshareextension</string>
</array>
<key>CFBundleURLTypes</key>
<array>
	<dict>
		<key>CFBundleURLSchemes</key>
		<array>
			<string>fb[appID]</string>
		</array>
	</dict>
</array>
<key>FacebookAppID</key>
<string>[appID]</string>
<key>FacebookDisplayName</key>
<string>[YourAppName]</string>

Basic Usage

import ShareModal from "react-native-share-modal";

<ShareModal
    visible={modalVisible}
    closeModal={() => setModalVisible(false)}
    data={{
      subject: "Something cool just launched !",
      message: "Come check this out !",
      url: "https://www.google.com",
      image: "file:///storage/emulated/0/Android/data/com.app_name/files/test.jpg"
    }}
/>

Props

PropertyTypeDefaultDescrption
visiblebooleanfalseToggle modal using state
closeModalCallback FunctionnullWhen the ShareModal's backdrop is clicked and callback to change the visible state
dataobject{}Data that is required for sharing through native side
localestringenLanguage to translate for library side (Check "Supported Locales" section for more info)
excludearray[]Add app names that you do not wish the include it in the sharing modal (See "Supported Apps" Section)

Supported Locales (11/8/2020)

LanguageLocale Code
Englishen
Malaymy
Chinesezh
Thaith
Vietnamesevn
Indonesianid

Supported Apps

AppNameiOSAndroid
Emailemail✔ (Default App)✔ (Gmail App)
SMSsms
Whatsappwhatsapp
Twittertwitter
Facebookfacebook
FB Messengermessenger
Telegramtelegram

Todos

  • Add in more social app support

License

MIT

Free Software, Hell Yeah!

Keywords

react-native

FAQs

Package last updated on 11 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts