我如何检查用户是否在Facebook上分享我的链接 [英] How I Check User Share My Link On Facebook Or Not

查看:330
本文介绍了我如何检查用户是否在Facebook上分享我的链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想查看该用户是否在Facebook上分享我的链接



如果他分享了,那么基于条件我想向他显示一页..





请任何人帮助我,



i使用asp.net,但如果可以使用javascript我管理我的代码,相应的

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

推荐答案

为此目的创建自定义按钮然后在javascript中使用registor click事件。在该事件中使用Fabebook API的FB.UI方法



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



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[^]


' #shareButton')。click(function(){
FB.ui({
方法:' share'
link:< span class =code-string>' samplelinktoshare'
caption:' 示例标题'
},函数(响应){
if (响应=== null ){
co nsole.log(' 未共享');
} 其他 {
// 成功分享,所以在这里写下你的下一个逻辑
}
});
});
('#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 } }); });


这篇关于我如何检查用户是否在Facebook上分享我的链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆