Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
通过Facebook Messenger共享链接-react原生android_Facebook_React Native_React Native Android_Facebook Share_React Native Fbsdk - Fatal编程技术网

通过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);
          }
        );
      }