Skip to content

Instantly share code, notes, and snippets.

@rad182
Created June 6, 2018 17:15
Show Gist options
  • Save rad182/e0ab10f282f7461769318ccbbe79cda6 to your computer and use it in GitHub Desktop.
Save rad182/e0ab10f282f7461769318ccbbe79cda6 to your computer and use it in GitHub Desktop.
rnfbsdk share dialog video
const videoURI = "file:///Users/xxx/Library/Developer/CoreSimulator/Devices/1D2A67CE-6DC7-…mp/react-native-image-crop-picker/7BDF6A4A-A2C7-4A7E-8CB3-4FE623C7EDE2.mp4";
const shareContent = {
contentType: 'video',
video: {
localUrl: videoURI,
},
};
ShareDialog.canShow(shareContent)
.then(canShow => {
console.log('canShow', canShow);
if (canShow) {
return ShareDialog.show(shareContent);
}
return false;
})
.then(
result => {
console.log('result:', result);
if (result.isCancelled) {
alert('Share cancelled');
} else {
alert(`Share success with postId: ${result.postId}`);
}
},
error => {
console.log('error', error);
alert(`Share fail with error: ${error}`);
},
)
.catch(error => console.log('error:', error));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment