1

I'm using react-native-fbsdk {ShareDialog} to post my feeds on Facebook but ShareDialog is not returning the post Id it's always null in my case.

enter image description here

My Import

import { ShareDialog, LoginManager, AccessToken, LoginButton } from "react-native-fbsdk";

This is my code

const shareLinkContent = {
  contentType: 'link',
  contentUrl: 'https://www.niofox.com/',
  contentDescription: 'Test Sharing Description'
};
var tmp = this;
ShareDialog.canShow(shareLinkContent).then(
  (canShow) => {
    if (canShow) {
      return ShareDialog.show(shareLinkContent);
    }
  }
).then(
  (result) => {
    if (result.isCancelled) {
      alert('Share cancelled');
    } else {
      alert('Share success with postId: ' + JSON.stringify(result));
    }
  },
  (error) => {
    alert('Share fail with error: ' + error);
  }
);
bad_coder
  • 11,289
  • 20
  • 44
  • 72
Ch Umair
  • 21
  • 3

0 Answers0