I am trying to share the (local uri) photo by using the react-native-fbsdk. I am able to share the link by using shareDialog. Not able to share the photo. I am getting the "Error: Unsupported scheme for media Uri" issue.
Here is my code:
const photoUri = '../../res/assets/images/sample.png';
const sharePhotoContent = {
contentType: 'photo',
photos: [{ imageUrl: photoUri }]
};
Hi,
I am trying to share the (local uri) photo by using the react-native-fbsdk. I am able to share the link by using shareDialog. Not able to share the photo. I am getting the "Error: Unsupported scheme for media Uri" issue.
Here is my code: const photoUri = '../../res/assets/images/sample.png'; const sharePhotoContent = { contentType: 'photo', photos: [{ imageUrl: photoUri }] };
const tmp = this; ShareDialog.canShow(this.state.sharePhotoContent) .then(function(canShow) { if (canShow) { return ShareDialog.show(tmp.state.sharePhotoContent); } }) .then( function(result) { if (result.isCancelled) { console.log('Share cancelled'); } else { console.log(
Share success with postId: ${result.postId}
); } }, function(error) { console.log(Share fail with error: ${error}
); } );Is there any thing wrong with the sharePhotoContent object which contains the image uri?