1 thought on “How to share local image as url??

  1. Hi there! I use react-native-fs to get the base64-encoded version of an image then pass to react-native-share:

    RNFS.readFile(RNFS.DocumentDirectoryPath + '/previews/test.jpg', 'base64').then((image) => {
      Share.open({
        url: 'data:image/jpeg;base64,' + image,
        type: 'image/jpeg'
      }).catch((err) => {
        // Handle error
        // ...
      });
    });

    Hopefully that helps. Good luck!

Comments are closed.

1 thought on “How to share local image as url??

  1. Hi there! I use react-native-fs to get the base64-encoded version of an image then pass to react-native-share:

    RNFS.readFile(RNFS.DocumentDirectoryPath + '/previews/test.jpg', 'base64').then((image) => {
      Share.open({
        url: 'data:image/jpeg;base64,' + image,
        type: 'image/jpeg'
      }).catch((err) => {
        // Handle error
        // ...
      });
    });

    Hopefully that helps. Good luck!

Comments are closed.