1.1.2 • Published 3 years ago

@react-native-social-share/core v1.1.2

Weekly downloads
17
License
MIT
Repository
github
Last release
3 years ago

@react-native-social-share/core

Getting started

$ npm install @react-native-social-share/core --save

Mostly automatic installation

$ react-native link react-native-core

Share via Facebook

** Require: react-native-fbsdk

Share via Twitter

** Require: @react-native-social-share/twitter

Share via Instagram

** Require: @react-native-social-share/instagram

Usage

import RNSocialShare from '@react-native-social-share/core';

RNSocialShare.shareLink("facebook", options);

Methods

  1. shareLink(provider, options)
  • provider: 'facebook' | 'twitter';
  • options: + link: string link to share + description: string (optional) + hashtag: string (optional) (Facebook and Twitter) + peopleIds: string (Facebook only) people ids to tag
const options = {
	link: "https://github.com/r0b0t3d/react-native-social-share",
	description: "React Native Social Share",
	peopleIds: "",
	hashtag: "#sharelink",
};
RNSocialShare.shareLink("facebook", options);

Note: Instagram do not support share link

  1. sharePhoto(provider, options)
  2. shareVideo(provider, options)
  • provider: 'facebook' | 'twitter' | 'instagram';
  • options: + localFile: string local file to share (required for Twitter sharing) + assetId: string assetId after saving to camera roll (required for Facebook & Instagram) + hashtag: string (optional) (Facebook and Twitter) + peopleIds: string (Facebook only) people ids to tag
import CameraRoll from '@react-native-community/

const localFile = "path/to/local/file";
const assetId = CameraRoll.save(localFile, { type: 'photo' });
const options = {
	localFile,
	assetId,
	peopleIds: "",
	hashtag: "#sharefile",
};
RNSocialShare.sharePhoto("facebook", options);
RNSocialShare.shareVideo("facebook", options);

Notes: Facebook and Instagram app must be installed

Twitter video limitation: https://github.com/twitter-archive/twitter-kit-ios/wiki/Compose-Tweets#video-requirements

1.1.2

3 years ago

1.1.0

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago