Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

React Native Facebook Video Share

$
0
0

I am trying to share a video from a react native app.

const shareVideoContent = {  contentType: 'video',  video: { localUrl: encodeURI(localPath) },  contentTitle: 'Sample Title',};console.log(shareVideoContent);ShareDialog.canShow(shareVideoContent).then((canShow) => {  if (canShow) {    return ShareDialog.show(shareVideoContent);  }}).then(  (result) => {    if (result.isCancelled) {      alert('Share operation was cancelled');    } else {      alert('Share was successful with postId: '+ result.postId);    }  },  (error) => {    alert('Share failed with error: '+ error.message);  });

I have tried the file from both albums and inside the app every time it shows SharingContent is invalid.

Couple of paths I have tried

{"localUrl": "ph://3C5FBF8E-4546-4D67-99F5-BC2F37EB7CEC/L0/001"}

{"localUrl": "/var/mobile/Containers/Data/Application/BC4AED6B-BF36-4D12-BD41-0898AE83260C/Documents/VID20843.mp4"}

I have the facebook app installed & logged in.


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>