facebookarchive / react-native-fbsdk

A React Native wrapper around the Facebook SDKs for Android and iOS. Provides access to Facebook login, sharing, graph requests, app events etc.
https://developers.facebook.com/docs/react-native
Other
2.99k stars 910 forks source link

Link Sharing to Messenger continue to support but message modal not show when Messenger open from my app #718

Open TranLuongTuanAnh opened 4 years ago

TranLuongTuanAnh commented 4 years ago

🐛 Bug Report

Link Sharing to Messenger continue to support but message modal not show when Messenger open from my app https://developers.facebook.com/docs/messenger-platform/changelog/#20200304

Expected Behavior

When I share link from my app to Messenger, message modal need to show

Code Example

constructor(props) {
    super(props);
    const shareLinkContent = {
      contentType: 'link',
      contentUrl: 'https://facebook.com',
      contentDescription: 'Facebook sharing is easy!'
    };
    this.state = {shareLinkContent: shareLinkContent};
}

fbMessageDialog() {
    var tmp = this;
    MessageDialog.canShow(this.state.shareLinkContent).then(
      function(canShow) {
        console.log(canShow)
        if (canShow) {
          return MessageDialog.show(tmp.state.shareLinkContent);
        }  
      }
    ).then(
      function(result) {
        console.log(result)
        if (result.isCancelled) {
          alert('Share cancelled');
        } else {
          alert('Share success with postId: ' + result.postId);
        }
      },
      function(error) {
        alert('Share fail with error: ' + error);
      }
    );
  }

Environment

react: 16.9.0 react-native: 0.61.4 react-native-fbsdk: 1.1.2

reactexcel commented 4 years ago

Using the same code above and result come as undefined and nothing happens is there any info on this react : 16.9.0 react-native:0.61.5 react-native-fbsdk: 1.1.1,