I want to share links only via Facebook
messenger. I have checked 3 libraries and none of them has what I need:
Share
(build-in in react-native): not possible to share links in Androidreact-native-share
: doesn't support sharing via FB messenger, only via Facebookreact-native-fbsdk
: not possible to share via messenger, only via FacebookHow is possible to implement this feature?
Found the solution in react-native-fbsdk, there is possibility to share links via Fb messenger using MessageDialog
.
shareLinkWithShareDialog= () => {
var tmp = this;
MessageDialog.canShow(this.state.shareLinkContent).then(
function(canShow) {
if (canShow) {
return MessageDialog.show(tmp.state.shareLinkContent);
}
}
).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);
}
);
}