How to use expo-sharing - 3 common examples

To help you get started, we’ve selected a few expo-sharing 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 expo / expo / apps / native-component-list / src / screens / SharingScreen.tsx View on Github external
_shareLocalImage = async () => {
    const asset = Asset.fromModule(image);
    await asset.downloadAsync();
    const tmpFile = FileSystem.cacheDirectory + 'chapeau.png';

    try {
      // sharing only works with `file://` urls on Android so we need to copy it out of assets
      await FileSystem.copyAsync({ from: asset.localUri!, to: tmpFile });
      await Sharing.shareAsync(tmpFile, {
        dialogTitle: 'Is it a snake or a hat?',
      });
    } catch (e) {
      console.error(e);
    }
  }
github EvanBacon / Expo-Crossy-Road / components / GameOver / Footer.js View on Github external
useEffect(() => {
    isAvailableAsync().then(setCanShare).catch(() => { });
  }, []);
github expo / expo / apps / native-component-list / src / screens / SharingScreen.tsx View on Github external
componentDidMount() {
    Sharing.isAvailableAsync().then(isAvailable =>
      this.setState({ isAvailable, loading: false })
    );
  }

expo-sharing

ExpoSharing standalone module

MIT
Latest version published 7 months ago

Package Health Score

85 / 100
Full package analysis