Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

hmi_react-native-share

Social share, sending simple data to other apps. Forked to allow sharing URLs/URIs - HeresMyInfo invitations

react-native, android, ios, windows, bridge, react, share

readme

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

React Native Share, a simple tool for share message and file to other apps.

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


If you are using react-native >= 0.60 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.

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. ❤️

changelog

Note

Now we are using semantic-release to handle the changelog for this package and their release. You can look at the entire change-log of each release here.

3.0.0-4 (2020-01-16)

Build System / Dependencies
  • deps: bump eslint-utils from 1.4.0 to 1.4.2 (#580) (62dd4ab3)
  • use react-native-share git master as dependency for RN60 example (b5eb9d36)
Chores
  • readme: mocking with Jest example (#610) (796ac3a6)
  • lint: fixing lint errors (4e78f355)
  • update example to use internal file provider, RN60 autolink works (aa126048)
  • use older flow package, run yarn (bdee601d)
  • fix react version to template versions (70b0fa38)
  • update gradle wrapper and distribution to 3.5.0/5.6.1-all (81bf5612)
  • update gradle in main project (5d459e78)
  • update dependencies and actually port example to RN60 (2ccc244a)
  • Adding es6 default export e export with destructing (018d2a3b)
  • ShareIntent: indentation fix (43fe0b51)
Continuous Integration
Bug Fixes
  • removing lint errors (a977d1f8)
  • added missing "v" to source field in podspec (#619) (d88e542d)
  • remove uncessary tools replace on build gradle (9ad34367)
  • instagram-stories build failure (56f50cc9)
  • update jest to fix known security vulnerabilities (#577) (f6c6105b)
  • remove redundant dependency (48492907)
  • use the template support version (1d7bf06d)
  • remove non-template gradle properties caching/parallel (85426520)
  • .iml files are in .gitignore and should not be committed (d7b60a50)
  • remove version from flowconfig (5c8b2e37)
  • social should be optional in android (abad39db)
Other Changes
  • Resolve promise if ShareSheet is manually dismissed (#607) (736a8ace)

1.2.1-5 (2019-05-29)

Chores
  • codeowners: add CODEOWNERS file (ac67e5cd)

1.2.0-4 (2019-05-26)

Build System / Dependencies
  • fix all deprecation and lint in ShareFile(s) (#374) (67fb59e9)
Chores
  • npmignore:
  • changelog: update changelog.js (85a91b05)
  • Adding instructions about how use the master branch (c1c58b87)
  • update iOS target to 9.0 to match react-native min version (f72dbe1a)
New Features
  • deps: update deps and prepare for release (#501) (05c2b6a1)

1.1.3-3 (2018-10-23)

Build System / Dependencies
  • reverse dep order, google then jcenter (#387) (2c91ecce)
  • upgrade android dependencies, example depend on upstream (#373) (28e62b15)
Bug Fixes
  • classes-not-exported: fix classes not exported warning (540aa8fe)

1.1.2-2 (2018-09-12)

1.1.1-1 (2018-08-07)

New Features
  • issue-template: add issue template (fde759f8)

1.1.0 (2018-07-25)

Build System / Dependencies
  • idx: add idx as dev dep and improve flow (eba00817)
Chores
  • readme: update readme with circle ci status badge (1a789ffe)
New Features
  • README: add pagesmanager only android (cb206d64)
  • gradle-3:
  • circl-flow-eslint:
  • circle-flow-eslint: first atempt add circle, add flow, eslint and prettier (44ac820e)
  • social: add social facebook pages manager (2537d3fe)
  • update format (a32ed6cd)
  • update readme for url format (dda13853)
Bug Fixes
  • changelog: fallback changelog script (b635de04)
  • flow: use Node and add CHANGELOG.md (ed6fcd32)
  • social: rename file FacebookPagesManager to FacebookPagesManagerShare (ac25bcad)
Other Changes