How to use the react-native-share.Social function in react-native-share

To help you get started, we’ve selected a few react-native-share examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github react-native-community / react-native-share / example / App.js View on Github external
const shareEmailImage = async () => {
    const shareOptions = {
      title: 'Share file',
      email: 'email@example.com',
      social: Share.Social.EMAIL,
      failOnCancel: false,
      urls: [images.image1, images.image2],
    };

    try {
      const ShareResponse = await Share.open(shareOptions);
      setResult(JSON.stringify(ShareResponse, null, 2));
    } catch (error) {
      console.log('Error =>', error);
      setResult('error: '.concat(getErrorString(error)));
    }
  };
github pillarwallet / pillarwallet / src / components / ShareSocial / ShareSocial.js View on Github external
shareOnSocialMedia = (platform: string, sharerUrl: string) => () => {
    Share.shareSingle({
      message: 'pillarproject.io/wallet',
      url: 'https://pillarproject.io/wallet',
      social: Share.Social[platform.toUpperCase()],
    })
      .catch(() => {
        Linking.openURL(sharerUrl);
      });
  };

react-native-share

Social share, sending simple data to other apps.

MIT
Latest version published 15 days ago

Package Health Score

92 / 100
Full package analysis