获取 Facebook 用户的 UserId
Get UserId of Facebook user
我有一个片段,允许我的 MVC Asp.net 站点上的用户发布 POST。它工作正常。
我需要的是当 POST 发布并且 facebook 用户点击它时(有一个 url 操作,如果用户点击它会将您带到我的网站)。我如何获得 userId 或表明它被 XXXX facebook 用户点击的东西?
一旦我网站上的用户发布此 post,朋友可能会点击 link,我想知道哪个用户点击了它。
function facebookShare()
{
FB.ui({
method: 'feed',
name: "My gallery - Price: .99",
link: "https://mygallery.net/Product/Details/99",
picture: "http://mygallery.com//Images/Products/image.jpg",
description: "In the last 100 years of....",
caption: "Product Name: Awesome Pix-X",
quote:"Quote: You will always be mine!"
},
function (response)
{
if (response && !response.error_message) {
alert('post_id : ' + response.post_id);
} else {
alert('Error while posting.');
}
});
}
所以我要不要在这里添加一个查询参数来动态获取点击它的facebook用户?
link: "https://mygallery.net/Product/Details/99",
如果用户没有授权你的App,那是无从知晓的。如果他授权了你的App,你可以通过FB.getLoginStatus
获取他的id,比如
我有一个片段,允许我的 MVC Asp.net 站点上的用户发布 POST。它工作正常。
我需要的是当 POST 发布并且 facebook 用户点击它时(有一个 url 操作,如果用户点击它会将您带到我的网站)。我如何获得 userId 或表明它被 XXXX facebook 用户点击的东西?
一旦我网站上的用户发布此 post,朋友可能会点击 link,我想知道哪个用户点击了它。
function facebookShare()
{
FB.ui({
method: 'feed',
name: "My gallery - Price: .99",
link: "https://mygallery.net/Product/Details/99",
picture: "http://mygallery.com//Images/Products/image.jpg",
description: "In the last 100 years of....",
caption: "Product Name: Awesome Pix-X",
quote:"Quote: You will always be mine!"
},
function (response)
{
if (response && !response.error_message) {
alert('post_id : ' + response.post_id);
} else {
alert('Error while posting.');
}
});
}
所以我要不要在这里添加一个查询参数来动态获取点击它的facebook用户? link: "https://mygallery.net/Product/Details/99",
如果用户没有授权你的App,那是无从知晓的。如果他授权了你的App,你可以通过FB.getLoginStatus
获取他的id,比如