通过Facebook Messenger共享链接-react原生android
我只想通过通过Facebook Messenger共享链接-react原生android,facebook,react-native,react-native-android,facebook-share,react-native-fbsdk,Facebook,React Native,React Native Android,Facebook Share,React Native Fbsdk,我只想通过Facebookmessenger共享链接。我检查了3个库,没有一个库有我需要的: 共享(内置react native):无法在Android中共享链接 react native share:不支持通过FB messenger共享,仅支持通过Facebook共享 react native fbsdk:无法通过messenger共享,只能通过Facebook共享 如何实现此功能 在react native fbsdk中找到了解决方案,可以使用MessageDialog通过Fb messe
Facebook
messenger共享链接。我检查了3个库,没有一个库有我需要的:
共享
(内置react native):无法在Android中共享链接react native share
:不支持通过FB messenger共享,仅支持通过Facebook共享react native fbsdk
:无法通过messenger共享,只能通过Facebook共享如何实现此功能 在react native fbsdk中找到了解决方案,可以使用
MessageDialog
通过Fb messenger共享链接
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);
}
);
}