Answer the question
In order to leave comments, you need to log in
How to find out if the user has shared or just closed the popup?
Actually, the question is in the title. Sharing (as well as social authorization) occurs in a popup - a popup opens, redirects to the social page occur on the server. network, on it all the data of what you want to share and the share button, after clicking on which the popup automatically closes. So how do you know that the user really shared (clicked on the button), and not just simply closed the popup?
UPD. The site does not use Javascript SDK social. networks - all communication with the social. networks occurs on the server through popups.
Answer the question
In order to leave comments, you need to log in
Should work.
$('#shareButton').click(function() {
FB.ui({
method: 'feed',
link: 'https://developers.facebook.com/docs/dialogs/',
caption: 'An example caption',
}, function(response){
if (response === null) {
console.log('was not shared');
} else {
console.log('shared - post id is ' + response.post_id);
}
});
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question