Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

type error null is not an object (evaluating 'ShareDialog.canShow') in React Native FBSDK

$
0
0

I have followed this GitHub URL to integrate Facebook sharing in my application. https://github.com/facebook/react-native-fbsdk Here is my code:

constructor(props){
        super(props);
        this.state={
            shareLinkContent : {
                contentType: 'link',
                contentDescription: 'Facebook sharing is easy!',
                contentUrl: 'https://cabbazar.com',
            },
    }
shareLinkWithShareDialog() {
    var tmp = this;
    ShareDialog.canShow(tmp.state.shareLinkContent).then(
      function(canShow) {
        if (canShow) {
          return ShareDialog.show(tmp.state.shareLinkContent);
        }
      }
    ).then(
      function(result) {
        console.log('handle result: ' + result);
      },
      function(error) {
        console.log('Share fail with error: ' + error);
      }
    );
  }

But I am always getting an error in my simulator. Do I need to setup anything in for Xcode? I checked this url but it is not solving my problem. null is not an object (evaluating 'ShareDialog.canShow')

This is the error which I am facing. Please suggest.

Thanks


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>