Skip to content
This repository has been archived by the owner on May 12, 2022. It is now read-only.

Social share, sending simple data to other apps.

License

Notifications You must be signed in to change notification settings

MetaMask/react-native-share

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-share CircleCI npm version

Share Social , Sending Simple Data to Other Apps

NOTE: React Native now implements share functionality Read more

Sponsors

If you use this library on your commercial/personal projects, you can help us by funding the work on specific issues that you choose by using IssueHunt.io!

This gives you the power to prioritize our work and support the project contributors. Moreover it'll guarantee the project will be updated and maintained in the long run.

issuehunt-image

Getting started

Mostly automatic install

  1. yarn add react-native-share
  2. react-native link react-native-share

How to use master branch?

We recommend using the releases from npm, however you can use the master branch if you need any feature that is not available on NPM. By doing this you will be able to use unreleased features, but the module may be less stable.

yarn: yarn add react-native-share@git+https://git@github.com/react-native-community/react-native-share.git

npm: npm install --save react-native-share@git+https://git@github.com/react-native-community/react-native-share.git

Manual install

npm install react-native-share --save

iOS Install

  1. npm install react-native-share --save
  2. In XCode, in the project navigator, right click Libraries âžś Add Files to [your project's name]
  3. Go to node_modules âžś react-native-share âžś ios and add RNShare.xcodeproj
  4. In XCode, in the project navigator, select your project. Add libRNShare.a to your project's Build Phases âžś Link Binary With Libraries
  5. In XCode, in the project navigator, select your project. Add Social.framework and MessageUI.framework to your project's General âžś Linked Frameworks and Libraries
  6. In iOS 9 or higher, You should add app list that you will share. If you want to share Whatsapp and Mailto, you should write LSApplicationQueriesSchemes in info.plist
    <key>LSApplicationQueriesSchemes</key>
    <array>
      <string>whatsapp</string>
      <string>mailto</string>
    </array>
  7. (Optional) Also following lines allows users to save photos, add them in info.plist
    <key>NSPhotoLibraryAddUsageDescription</key>
    <string>$(PRODUCT_NAME) wants to save photos</string>
  8. Run your project (Cmd+R)

iOS Install(using Pods)

If you wish, you can use cocopoads to use react-native-share.

You just need to add to your Podfile the react-native-share dependency.

  # React-Native-Share pod
  pod 'RNShare', :path => '../node_modules/react-native-share'

After that, just run a pod install or pod udpate to get up and running with react-native-share.

Then run a react-native link react-native-share, and doing the steps 6 and 7.

You can also see our example to see how you need to setup your podfile.

Btw, We also recommend reading this (amazing article)[https://shift.infinite.red/beginner-s-guide-to-using-cocoapods-with-react-native-46cb4d372995] about how pods and rn work together. =D

Android Install

  1. npm install react-native-share --save

  2. Open up android/app/src/main/java/[...]/MainApplication.java

    • Add import cl.json.RNSharePackage; and import cl.json.ShareApplication; to the imports at the top of the file
    • Add new RNSharePackage() to the list returned by the getPackages() method
  3. Append the following lines to android/settings.gradle:

    include ':react-native-share'
    project(':react-native-share').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-share/android')
    
  4. Insert the following lines inside the dependencies block in android/app/build.gradle:

      compile project(':react-native-share')
    
  5. (Optional) Follow this for implementing Provider

Windows Install

Read it! :D

  1. npm install react-native-share --save
  2. In Visual Studio add the RNShare.sln in node_modules/react-native-share/windows/RNShare.sln folder to their solution, reference from their app.
  3. Open up your MainPage.cs app
  • Add using Cl.Json.RNShare; to the usings at the top of the file
  • Add new RNSharePackage() to the List<IReactPackage> returned by the Packages method

Methods

open(options)

Open Simple share dialog

Returns a promise that fulfills or rejects as soon as user successfully open the share action sheet or cancelled/failed to do so. As a result you might need to further handle the rejection while necessary. e.g.

  Share.open(options)
    .then((res) => { console.log(res) })
    .catch((err) => { err && console.log(err); });

Supported options:

Name Type Description
url string URL you want to share (you can share a base64 file url only in iOS & Android )
urls Array[string] URL's you want to share, Only for iOS and Android (you can share a base64 file url only in iOS & Android )
type string File mime type (optional)
message string
title string (optional)
subject string (optional)
excludedActivityTypes string (optional)
failOnCancel boolean (defaults to true) Specifies whether promise should reject if user cancels share dialog (optional)
showAppsToView boolean (optional) only android

shareSingle(options) (in iOS & Android)

Open share dialog with specific application

This returns a promise too.

Supported options:

Name Type Description
url string URL you want to share
type string File mime type (optional)
message string
title string (optional)
subject string (optional)
social string supported social apps: List
forceDialog boolean (optional) only android. Avoid showing dialog with buttons Just Once / Always. Useful for Instagram to always ask user if share as Story or Feed

NOTE: If both message and url are provided url will be concatenated to the end of message to form the body of the message. If only one is provided it will be used

isPackageInstalled (in Android)

It's a method that checks if an app (package) is installed on Android. It returns a promise with isInstalled. e.g.

Checking if Instagram is installed on Android.

Share.isPackageInstalled('com.instagram.android')
  .then(({ isInstalled }) => console.log(isInstalled))

NOTE: in iOS you can use Linking.canOpenURL(url)

Static Values for social

These can be assessed using Share.Social property For eg.

import Share from 'react-native-share';

const shareOptions = {
    title: 'Share via',
    message: 'some message',
    url: 'some share url',
    social: Share.Social.WHATSAPP
};
Share.shareSingle(shareOptions);
Name Android iOS Windows
FACEBOOK yes yes no
PAGESMANAGER yes no no
WHATSAPP yes yes no
INSTAGRAM yes yes no
GOOGLEPLUS yes yes no
EMAIL yes yes no
PINTEREST yes no no
SMS yes no no
SNAPCHAT yes no no
MESSENGER yes no no

How it looks:

Android IOS Windows
Simple Share Demo Android Demo iOS Demo Windows
UI Component Demo Android UI Component Demo Android UI Component TODO

Usage

Example code

import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  TouchableOpacity,
  View,
  Clipboard,
  ToastAndroid,
  AlertIOS,
  Platform
} from 'react-native';
import Share, {ShareSheet, Button} from 'react-native-share';

class TestShare extends Component {
  constructor(props) {
    super(props);
    this.state = {
      visible: false
    }
  }
  onCancel() {
    console.log("CANCEL")
    this.setState({visible:false});
  }
  onOpen() {
    console.log("OPEN")
    this.setState({visible:true});
  }
  render() {

    let shareOptions = {
      title: "React Native",
      message: "Hola mundo",
      url: "http://facebook.github.io/react-native/",
      subject: "Share Link" //  for email
    };

    let shareImageBase64 = {
      title: "React Native",
      message: "Hola mundo",
      url: REACT_ICON,
      subject: "Share Link" //  for email
    };

    return (
      <View style={styles.container}>


        <TouchableOpacity onPress={()=>{
          Share.open(shareImageBase64);
        }}>
          <View style={styles.instructions}>
            <Text>Simple Share Image Base 64</Text>
          </View>
        </TouchableOpacity>

        <TouchableOpacity onPress={()=>{
          Share.open(shareOptions);
        }}>
          <View style={styles.instructions}>
            <Text>Simple Share</Text>
          </View>
        </TouchableOpacity>

        <TouchableOpacity onPress={this.onOpen.bind(this)}>
          <View style={styles.instructions}>
            <Text>Share UI Component</Text>
          </View>
        </TouchableOpacity>

        <ShareSheet visible={this.state.visible} onCancel={this.onCancel.bind(this)}>
          <Button iconSrc={{ uri: TWITTER_ICON }}
                  onPress={()=>{
              this.onCancel();
              setTimeout(() => {
                Share.shareSingle(Object.assign(shareOptions, {
                  "social": "twitter"
                }));
              },300);
            }}>Twitter</Button>
          <Button iconSrc={{ uri: FACEBOOK_ICON }}
                  onPress={()=>{
              this.onCancel();
              setTimeout(() => {
                Share.shareSingle(Object.assign(shareOptions, {
                  "social": "facebook"
                }));
              },300);
            }}>Facebook</Button>
          <Button iconSrc={{ uri: WHATSAPP_ICON }}
                  onPress={()=>{
              this.onCancel();
              setTimeout(() => {
                Share.shareSingle(Object.assign(shareOptions, {
                  "social": "whatsapp"
                }));
              },300);
            }}>Whatsapp</Button>
          <Button iconSrc={{ uri: GOOGLE_PLUS_ICON }}
                  onPress={()=>{
              this.onCancel();
              setTimeout(() => {
                Share.shareSingle(Object.assign(shareOptions, {
                  "social": "googleplus"
                }));
              },300);
            }}>Google +</Button>
          <Button iconSrc={{ uri: EMAIL_ICON }}
                  onPress={()=>{
              this.onCancel();
              setTimeout(() => {
                Share.shareSingle(Object.assign(shareOptions, {
                  "social": "email"
                }));
              },300);
            }}>Email</Button>
          <Button iconSrc={{ uri: PINTEREST_ICON }}
                  onPress={()=>{
              this.onCancel();
              setTimeout(() => {
                Share.shareSingle(Object.assign(shareOptions, {
                  "social": "pinterest"
                }));
              },300);
            }}>Pinterest</Button>
          <Button
            iconSrc={{ uri: CLIPBOARD_ICON }}
            onPress={()=>{
              this.onCancel();
              setTimeout(() => {
                if(typeof shareOptions["url"] !== undefined) {
                  Clipboard.setString(shareOptions["url"]);
                  if (Platform.OS === "android") {
                    ToastAndroid.show('Link copiado al portapapeles', ToastAndroid.SHORT);
                  } else if (Platform.OS === "ios") {
                    AlertIOS.alert('Link copiado al portapapeles');
                  }
                }
              },300);
            }}>Copy Link</Button>
          <Button iconSrc={{ uri: MORE_ICON }}
            onPress={()=>{
              this.onCancel();
              setTimeout(() => {
                Share.open(shareOptions)
              },300);
            }}>More</Button>
        </ShareSheet>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  instructions: {
    marginTop: 20,
    marginBottom: 20,
  },
});

//  twitter icon
const TWITTER_ICON = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAMAAAANIilAAAABvFBMVEUAAAAA//8AnuwAnOsAneoAm+oAm+oAm+oAm+oAm+kAnuwAmf8An+0AqtUAku0AnesAm+oAm+oAnesAqv8An+oAnuoAneoAnOkAmOoAm+oAm+oAn98AnOoAm+oAm+oAmuoAm+oAmekAnOsAm+sAmeYAnusAm+oAnOoAme0AnOoAnesAp+0Av/8Am+oAm+sAmuoAn+oAm+oAnOoAgP8Am+sAm+oAmuoAm+oAmusAmucAnOwAm+oAmusAm+oAm+oAm+kAmusAougAnOsAmukAn+wAm+sAnesAmeoAnekAmewAm+oAnOkAl+cAm+oAm+oAmukAn+sAmukAn+0Am+oAmOoAmesAm+oAm+oAm+kAme4AmesAm+oAjuMAmusAmuwAm+kAm+oAmuoAsesAm+0Am+oAneoAm+wAmusAm+oAm+oAm+gAnewAm+oAle0Am+oAm+oAmeYAmeoAmukAoOcAmuoAm+oAm+wAmuoAneoAnOkAgP8Am+oAm+oAn+8An+wAmusAnuwAs+YAmegAm+oAm+oAm+oAmuwAm+oAm+kAnesAmuoAmukAm+sAnukAnusAm+oAmuoAnOsAmukAqv9m+G5fAAAAlHRSTlMAAUSj3/v625IuNw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nScAR3nxQNcIqrqRqWHW8Qd6cY94oGER8STMVioZsQLLnEXw1mMr5OqFdGGS378wxgzZvwO5jiz2wFnjxABOufdfQAAAABJRU5ErkJggg==";

//  whatsapp icon
const WHATSAPP_ICON = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAMAAAANIilAAAACzVBMVEUAAAAArQAArgAArwAAsAAAsAAAsAAAsAAAsAAAsAAAsAAAsAAArwAAtgAAgAAAsAAArwAAsAAAsAAAsAAAsAAAsgAArwAAsAAAsAAAsAAAsQAAsAAAswAAqgAArQAAsAAAsAAArwAArwAAsAAAsQAArgAAtgAAsQAAuAAAtAAArwAAsgAAsAAArAAA/wAAsQAAsAAAsAAAsAAAzAAArwAAsAAAswAAsAAAsAAArQAAqgAAsAAAsQAAsAAAsAAAsAAAqgAAsQAAsAAAsAAArwAAtAAAvwAAsAAAuwAAsQAAsAAAsAAAswAAqgAAswAAsQAAswAAsgAAsAAArgAAsAAAsAAAtwAAswAAsAAAuQAAvwAArwAAsQAAsQAAswAAuQAAsAAAsAAArgAAsAAArgAArAAAsAAArgAArgAAsAAAswAArwAAsAAAsQAArQAArwAArwAAsQAAsAAAsQAAsQAAqgAAsAAAsAAAsAAAtAAAsAAAsQAAsAAAsAAAsAAArgAAsAAAsQAAqgAAsAAAsQAAsAAAswAArwAAsgAAsgAAsgAApQAArQAAuAAAsAAArwAAugAArwAAtQAArwAAsAAArgAAsAAAsgAAqgAAsAAAsgAAsAAAzAAAsQAArwAAswAAsAAArwAArgAAtwAAsAAArwAAsAAArwAArwAArwAAqgAAsQAAsAAAsQAAnwAAsgAArgAAsgAArwAAsAAArwAArgAAtAAArwAArwAArQAAsAAArwAArwAArwAAsAAAsAAAtAAAsAAAswAAsgAAtAAArQAAtgAAsQAAsQAAsAAAswAAsQAAsQAAuAAAsAAArwAAmQAAsgAAsQAAsgAAsAAAsgAAsAAArwAAqgAArwAArwAAsgAAsQAAsQAArQAAtAAAsQAAsQAAsgAAswAAsQ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NKec01WczxfsX5KlOrM86w0CQRlhCcQmaLiX5SxxeRKWPA1XszwNBZjak5bdqGPg/fvQrpVYwtWAUq2Lx4hHSJY0Nz+3hnsx5iKwEoBVROEbWSDxCcyJ/SmfdhxG7ifPqnkI5turfSoE/0K5p2lMcrIG5Filmclgy7a01Qrerm+q8ycu6bPtvpKMN2R9M10WfvDjuuFhlN7dsbNd1wbpdRyVvXdYsd5b1gZDqTE58oB+fe6TOEFGJ+h1YssppvApU9R2oUidDb8dJn/iQKOsVZhDlKoZVm7X30HgvKkAhRk/8RAlBfmdYAxsuLSMznKyZdsIDTHwcFspGUvLSBE9bK/rQADvepX+0K09glFX/WGZJa/aBe06QT5EDfedOqRTnHWbOmeB5cQQw1S5IPSLetEJsC05cTf0S6u1WSwnX1xH8OzyLH/NNgN+u1bmJmEuUMGFlm7SkwhVlcb89bCsIIU0yBQphlulhOpARXTu/TkmWxqo1l9BMcy3caObJEQODIFDRITVuEyiyWuBxJH+yR7POQr3qrt3qrt3qrt3qrt3qrt3qrt3rrQ+3/ATxSgu3z5tTfAAAAAElFTkSuQmCC';

AppRegistry.registerComponent('TestShare', () => TestShare);

Url format when sharing a file

Share base 64 file

When share a base 64 file, please follow the format below:

url: "data:<data_type>/<file_extension>;base64,<base64_data>"

For example, when share a base 64 mp3 file, the url should be:

url: "data:audio/mp3;base64,<base64_data>"

When share a base 64 image file with png file extension, the url should be:

url: "data:image/png;base64,<base64_data>"

Share file directly

When share a local file directly, please follow the format below:

url: "file://<file_path>",

For example, when share a pdf file from: /storage/emulated/0/demo/test.pdf, the url should be:

url: "file:///storage/emulated/0/demo/test.pdf"

Troubleshooting

Share Remote PDF File with Gmail & WhatsApp (iOS)

When sharing a pdf file with base64, there are two current problems.

  1. On WhatsApp base64 wont be recognized => nothing to share
  2. In the GmailApp the file extension is wrong (.dat).

Therefore we use this "workaround" in order to handle pdf sharing for iOS Apps to mentioned Apps

  1. Install react-native-fetch-blob
  2. Set a specific path in the RNFetchBlob configurations
  3. Download the PDF file to temp device storage
  4. Share the response's path() of the donwloaded file directly

Code:

static sharePDFWithIOS(fileUrl, type) {
  let filePath = null;
  let file_url_length = fileUrl.length;
  const configOptions = {
    fileCache: true,
    path:
      DIRS.DocumentDir + (type === 'application/pdf' ? '/SomeFileName.pdf' : '/SomeFileName.png') // no difference when using jpeg / jpg / png /
  };
  RNFetchBlob.config(configOptions)
    .fetch('GET', fileUrl)
    .then(async resp => {
      filePath = resp.path();
      let options = {
        type: type,
        url: filePath // (Platform.OS === 'android' ? 'file://' + filePath)
      };
      await Share.open(options);
      // remove the image or pdf from device's storage
      await RNFS.unlink(filePath);
    });
}

Nothing to do on Android. You can share the pdf file with base64

static sharePDFWithAndroid(fileUrl, type) {
  let filePath = null;
  let file_url_length = fileUrl.length;
  const configOptions = { fileCache: true };
  RNFetchBlob.config(configOptions)
    .fetch('GET', fileUrl)
    .then(resp => {
      filePath = resp.path();
      return resp.readFile('base64');
    })
    .then(async base64Data => {
      base64Data = `data:${type};base64,` + base64Data;
      await Share.open({ url: base64Data });
      // remove the image or pdf from device's storage
      await RNFS.unlink(filePath);
    });
}

Adding your implementation of FileProvider

Android guide.

  • applicationId should be defined in the defaultConfig section in your android/app/build.gradle:

  • File: android/app/build.gradle

    defaultConfig {
        applicationId "com.yourcompany.yourappname"
        ...
    }
    
  • Add this <provider> section to your AndroidManifest.xml

    File: AndroidManifest.xml

    <application>
        <provider
            android:name="android.support.v4.content.FileProvider"
            android:authorities="${applicationId}.provider"
            android:grantUriPermissions="true"
            android:exported="false">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/filepaths" />
        </provider>
    </application>
  • Create a filepaths.xml under this directory: android/app/src/main/res/xml.

    In this file, add the following contents:

    File: android/app/src/main/res/filepaths.xml

    <?xml version="1.0" encoding="utf-8"?>
    <paths xmlns:android="http://schemas.android.com/apk/res/android">
      <external-path name="myexternalimages" path="Download/" />
    </paths>
  • Edit your MainApplication.java class to add implements ShareApplication and getFileProviderAuthority

  • The getFileProviderAuthority function returns the android:authorities value added in the AndroidManifest.xml file

  • applicationId is defined in the defaultConfig section of your android/app/build.gradle and referenced using BuildConfig.APPLICATION_ID

    import cl.json.ShareApplication
    public class MainApplication extends Application implements ShareApplication, ReactApplication {
    
         @Override
         public String getFileProviderAuthority() {
                return BuildConfig.APPLICATION_ID + ".provider";
         }
    
         // ...Your own code
    
    }

About

Social share, sending simple data to other apps.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 48.4%
  • Objective-C 26.6%
  • JavaScript 17.1%
  • C# 5.5%
  • Python 1.8%
  • Ruby 0.6%