Click here to Skip to main content
15,891,372 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi,
I want to check that user share my link on facebook or not

and if he shared, then based on that condition i Want to display one page to him..


please any one help me,

i use asp.net, but if it is possible using javascript i mange my code, accordingly
Posted

1 solution

Create your custom button for this purpose then registor click event in javascript. Inside that event use FB.UI method of Fabebook API

https://developers.facebook.com/docs/sharing/reference/share-dialog[^]

C#
$('#shareButton').click(function() {
    FB.ui({
        method: 'share',
        link: 'samplelinktoshare',
        caption: 'An example caption',
    }, function(response){
        if (response === null) {
            console.log('was not shared');
        } else {
            //Successfully shared, so write your next logic here
        }
    });
});
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900