[英]How to get which user has liked page from FB page plugin
I used Facebook Page Plugin to display page like widget ( https://developers.facebook.com/docs/plugins/page-plugin ) on my site. 我使用Facebook Page Plugin在我的网站上显示诸如小部件( https://developers.facebook.com/docs/plugins/page-plugin )之类的页面。 When I run my site FB page widget is open with like and share buttons. 当我运行我的网站时,FB页面窗口小部件会用“喜欢”和“共享”按钮打开。 When user clicks on like it opens a popup and prompt user to enter FB login once user enters it and authenticated the widget is refreshed and now like button is greyed out. 当用户单击时,它会打开一个弹出窗口,并提示用户输入FB登录,一旦用户输入它并通过身份验证,便会刷新小部件,现在就像按钮变灰一样。 How do I know the user details who liked the page? 我如何知道喜欢该页面的用户详细信息? I want to save these details so that I can check if user has already liked the page or not if yes they can use the site directly if not then they must first like the page and then use the site. 我想保存这些详细信息,以便我可以检查用户是否已经喜欢该页面,如果可以,则可以直接使用该站点,否则,他们必须先喜欢该页面然后使用该站点。 My application is built on C# ASP.Net MVC. 我的应用程序基于C#ASP.Net MVC构建。 I also want the request to Facebook should go from it from C# code. 我也希望对Facebook的请求应该来自C#代码。 Let me know the correct process in case I'm not following correct procedure. 如果我没有遵循正确的程序,请告诉我正确的过程。
FB page like widget code is FB页面之类的小部件代码是
<div class="fb-page" data-href="https://facebook.com/codeblends" data-width="380" data-hide-cover="false" data-show-facepile="false" data-hide-cta="true"
data-show-posts="false"></div>
In JS 在JS中
window.fbAsyncInit = function () {
FB.init({
appId: '@ReadConfig.FacebookAppID',
cookie: true,
xfbml: true,
version: '@ReadConfig.FacebookAPIVersion'
});
FB.Event.subscribe('edge.create', finished_rendering);
(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 = "https://connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
The only way to check if a user liked a Page is to authorize the user with the user_likes
permission. 检查用户是否喜欢页面的唯一方法是使用user_likes
权限授权该用户。 You would have to go through Facebooks review process with that permission, and Facebook will definitely not approve the usage for your case, because what you are trying to achieve is not allowed. 您必须获得该许可才能通过Facebook的审查程序,Facebook绝对不会批准您的案例的用法,因为您要达到的目的是不允许的。 Like gating is not allowed since many years. 自从多年以来,不允许门控。
You must read the platform policy: https://developers.facebook.com/policy/ 您必须阅读平台政策: https : //developers.facebook.com/policy/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.