0.2.10 • Published 4 years ago

react-native-share-modal v0.2.10

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

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!

0.2.10

4 years ago

0.2.9

4 years ago

0.2.8

4 years ago

0.2.7

4 years ago

0.2.6

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.4

4 years ago

0.1.5

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.20

4 years ago

0.0.18

4 years ago

0.0.19

4 years ago

0.0.17

4 years ago

0.0.10

4 years ago

0.0.11

4 years ago

0.0.12

4 years ago

0.0.13

4 years ago

0.0.14

4 years ago

0.0.15

4 years ago

0.0.9

4 years ago

0.0.16

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago