contentDescription和contentTitle在共享期间不起作用(react-native-fbsdk)

时间:2018-10-11 12:28:12

标签: facebook react-native react-native-android facebook-share react-native-fbsdk

我正在通过Facebook Messenger共享链接,并且还希望共享标题和内容描述。但是,内容描述和内容标题永远不会出现,只有链接。

这是代码:

state = {
shareLinkContent: {
      contentType: 'link',
      contentUrl: "https://facebook.com",
      contentDescription: 'Wow, check out this great site!',
      contentTitle: "Test title"
    }
}

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

0 个答案:

没有答案