Share Callback not working
this is my code
<FacebookProvider appId="key"> <Share href="http://www.facebook.com" onResponse={this.handleResponse} onError={this.handleError}> {({ handleClick, loading,error,data }) => ( <button type="button" disabled={loading} onClick={handleClick} >Share</button> )} </Share> </FacebookProvider>
After y share post, handleResponse fuction not called . If I cancel share , I get error

Who can demo help me resolve this problem
yes, i would be interested in seeing how this works. Or with the Feed option.
export default class SocialShare extends Component {
handleResponse = (data) => {
console.log(data);
}
handleError = (error) => {
console.log(error);
}
render() {
return (
<FacebookProvider appId="436255920314257">
<Feed link="https://www.facebook.com" onCompleted={this.handleResponse} onError={this.handleError}>
{({ handleClick }) => (
<button type="button" onClick={handleClick}>Share on Feed</button>
)}
</Feed>
</FacebookProvider>
}
}
I would of thought the above would of worked for Share Button and Feed Button
I get the following error when closing the dialog box
Hi, I am also facing the same issue with share button. I've even tried giving user_posts permission to my test user for my app.
handleClick = (caption) => { var hours = 24; // Reset when storage is more than 24hours var now = new Date().getTime(); var setupTime = localStorage.getItem('setupTime'); if ((now - setupTime > hours * 60 * 60 * 1000) || !setupTime) { localStorage.removeItem('CURRENT_USER'); localStorage.removeItem('setupTime'); this.props.actShowLoginFb(); } else { //SDK loaded, initialize it window.FB.init({ appId: AppConstants.FACEBOOK_APPID, xfbml: true, version: 'v2.6' }); const props = this.props.item; const th = this; //JS SDK initialized, now you can use it window.FB.ui({ method: 'share', title: 'Title Goes here', description: '. ', href: caption, }, function (response) { if (response && !response.error_code) { th.props.actSharedSuccess(props.id).then(() => { }); } else { } }); //load the JavaScript SDK (function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) { return; } js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); } }
this is my code. Hoping to resolve y . But this sharing doesn't display image and title share because my project is client side !