12.0.9 • Published 8 months ago

react-native-share v12.0.9

Weekly downloads
78,648
License
MIT
Repository
github
Last release
8 months ago

react-native-share react-native-share npm version semantic-release

React Native Share, is a simple tool for sharing messages and files with other apps.

Getting started 🚀


Expo Managed Workflow

For Expo projects, you will need to be on a managed workflow and use the following command:

npx expo install react-native-share

Configure you app.config.ts or app.json to use the permissions needed by the library:

{
  "plugins": [
    [
      "react-native-share",
      {
        "ios": [
          "fb",
          "instagram",
          "twitter",
          "tiktoksharesdk",
        ],
        "android": [
          "com.facebook.katana",
          "com.instagram.android",
          "com.twitter.android",
          "com.zhiliaoapp.musically",
        ],
        "enableBase64ShareAndroid": true
      }
    ]
  ]
}

ios parameter will take care of adding queries (LSApplicationQueriesSchemes) to the Info.plist.

<key>LSApplicationQueriesSchemes</key>
<array>
  <string>fb</string>
  <string>instagram</string>
  <string>twitter</string>
  <string>tiktoksharesdk</string>
</array>

android parameter will take care of adding queries to the AndroidManifest.xml.

<queries>
  <package android:name="com.facebook.katana" />
  <package android:name="com.instagram.android" />
  <package android:name="com.twitter.android" />
  <package android:name="com.zhiliaoapp.musically" />
</queries>

enableBase64ShareAndroid will take care of adding the permission to the AndroidManifest.xml.

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

And prebuild the project with expo prebuild.

Bare React Native

If you are using react-native >= 0.7X and/or the new arch you just need to do a simple:

yarn add react-native-share

Or if are using npm:

npm i react-native-share --save

After that, we need to install the dependencies to use the project on iOS(you can skip this part if you are using this on Android).

Now run a simple: npx pod-install or cd ios && pod install. After that, you should be able to use the library on both Platforms, iOS and Android.

Usage

Then simply import:

import Share from 'react-native-share';

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

Which you do something similar to this:

example-ios

Documentation

If you are using a older version of react-native or react-native-share, having any problem or want to know how use Share.open and other functions, please refer to our new docs and help us improve that.🚀

@borderfreefinancial/revoconsumermobileapp-test@borderfreefinancial/revoshowmobileui-test@borderfreefinancial/revoshowui-testreact-native-craft-kiti-invest-wealth@infinitebrahmanuniverse/nolb-react-native-sh@everything-registry/sub-chunk-2591@cvs-stock/shareaholic-profit-sharing-templatestorybook-componentsstorybook-compo@praella/klarify-utilsipanel-rnapp-ajb-corejabo-react-native-super-simple-chatkvell-app-uikvell-app-ui-testlibre-crm@womasoft/rn-libs@types/react-native-share@yoronsoft/rn-libs@zalastax/nolb-react-native-shbabelmansantimpackage@cloud-varejo/cloud-varejo-ui@acflow/package-example@acflow/react-native-logger-manager@acflow/rnc@edlar2020/miselfappui-amber@bytexbyte/berify-scan@gaozh1024/rn-libs@kvell/kvell-app-ui@lgowrav/testapp@kafudev/react-native-core@kafudev/react-native-shell@react-native-oh-tpl/react-native-share@protonapp/proton-runner@quintype/native-components@sans/animation@sans/react-native-ux@sans/theme@sans/uimoniclfinmidas_boilerplate_webviewodappspaga-con-btc-uipalette-mobilesans-uiscorpiousscorpious_kogoreact-native-fusionchartreact-native-fusionchartsraven-mobile-posrnshellrn-vayvayrn-splatformreact-native-abbyy-mobile-capture-sample-core-apirytssanslib-uisanspkgsansuxsansuireact-native-logfile-sharereact-native-matrixreact-native-mall-frame-clientreact-native-mallframe-libraryreact-flyy-sdk-modulereact-native-vs-file-loggernodjs-mobile-native-templaterex-lib-1recytrackrect-native-fusionchartreact-native-torpedo-packagecash-cropbigwallet@shareaholic/template@shopify/shop-minis-sdk@shopify/shop-minis-runtime@seshubonam123/react-native-matrix@studyworld/mobile-shared@fadyshawky/react-native-magic@apparatus/meta-start-preset@apparatus/gig-containers-share@infobizzs/rn-form-builder@didcky/jaijagga
12.0.7

8 months ago

12.0.8

8 months ago

12.0.9

8 months ago

12.0.3

11 months ago

12.0.4

8 months ago

12.0.5

8 months ago

12.0.6

8 months ago

12.0.0

11 months ago

12.0.1

11 months ago

12.0.2

11 months ago

11.1.0

11 months ago

11.0.4

1 year ago

11.0.2

1 year ago

11.0.3

1 year ago

11.0.0

1 year ago

11.0.1

1 year ago

10.2.1

1 year ago

10.2.0

1 year ago

10.1.0

2 years ago

10.0.0

2 years ago

10.0.1

2 years ago

10.0.2

2 years ago

9.4.1

2 years ago

9.4.0

2 years ago

9.0.2

2 years ago

9.0.1

2 years ago

9.0.0

2 years ago

9.2.4

2 years ago

9.2.3

2 years ago

9.2.2

2 years ago

9.2.1

2 years ago

9.1.1

2 years ago

9.1.0

2 years ago

9.3.0

2 years ago

9.2.0

2 years ago

8.2.2

3 years ago

8.2.1

3 years ago

8.2.0

3 years ago

8.1.0

3 years ago

7.9.1

3 years ago

8.0.1

3 years ago

8.0.0

3 years ago

7.9.0

3 years ago

7.8.0

3 years ago

7.5.0

3 years ago

7.6.2

3 years ago

7.6.1

3 years ago

7.6.0

3 years ago

7.6.6

3 years ago

7.6.5

3 years ago

7.6.4

3 years ago

7.6.3

3 years ago

7.7.1

3 years ago

7.7.0

3 years ago

7.4.1

3 years ago

7.4.0

3 years ago

7.3.9

4 years ago

7.3.8

4 years ago

7.3.7

4 years ago

7.3.5

4 years ago

7.3.4

4 years ago

7.3.3

4 years ago

7.3.6

4 years ago

7.3.1

4 years ago

7.3.0

4 years ago

7.3.2

4 years ago

7.2.1

4 years ago

7.1.2

4 years ago

7.2.0

4 years ago

7.1.1

4 years ago

7.1.0

4 years ago

7.0.2

4 years ago

7.0.1

4 years ago

6.5.0

4 years ago

7.0.0

4 years ago

6.4.0

4 years ago

6.3.0

4 years ago

6.2.3

4 years ago

6.2.2

4 years ago

6.2.1

4 years ago

6.2.0

4 years ago

6.1.0

4 years ago

6.0.1

4 years ago

5.3.0

4 years ago

5.2.3

4 years ago

6.0.0

4 years ago

5.2.2

5 years ago

5.2.1

5 years ago

5.2.0

5 years ago

5.1.7

5 years ago

5.1.5

5 years ago

5.1.6

5 years ago

5.1.4

5 years ago

5.1.3

5 years ago

5.1.2

5 years ago

5.1.1

5 years ago

5.1.0

5 years ago

5.0.0

5 years ago

4.1.2

5 years ago

4.1.1

5 years ago

4.1.0

5 years ago

4.0.4

5 years ago

4.0.3

5 years ago

4.0.2

5 years ago

4.0.1

5 years ago

4.0.0

5 years ago

3.8.5

5 years ago

3.8.4

5 years ago

3.8.3

5 years ago

3.8.2

5 years ago

3.8.1

5 years ago

3.8.0

5 years ago

3.7.1

5 years ago

3.7.0

5 years ago

3.6.0

5 years ago

3.5.0

5 years ago

3.4.0

5 years ago

3.3.3

5 years ago

3.3.2

5 years ago

3.3.1

5 years ago

3.3.0

5 years ago

3.2.0

6 years ago

3.1.2

6 years ago

3.1.1

6 years ago

3.1.0

6 years ago

3.0.0

6 years ago

2.0.0

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.27

8 years ago

1.0.26

8 years ago

1.0.25

8 years ago

1.0.24

8 years ago

1.0.23

8 years ago

1.0.22

8 years ago

1.0.21

8 years ago

1.0.20

9 years ago

1.0.19

9 years ago

1.0.18

9 years ago

1.0.17

9 years ago

1.0.16

9 years ago

1.0.15

9 years ago

1.0.14

9 years ago

1.0.13

9 years ago

1.0.12

9 years ago

1.0.11

9 years ago

1.0.10

9 years ago

1.0.9

10 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0-rc

10 years ago

1.0.0

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago