开发者

Some sites "see" my facebook account, and I've never linked it. How do I imitate this?

I've never been to Yelp on this new computer I'm on, however that site was able to see that I'm a facebook user and cusomized the site for me.

Can someone tell me how this is accomplish开发者_如何转开发ed, and what I need to do to imitate this?


You've authorized a Yelp owned Facebook application somewhere (from your phone, yelp.com, or somewhere). If you authorize a Facebook application, that application has access to information that you provide to it through your Facebook account. Meaning, you should be able to see a "Yelp-owned" application listed here: http://www.facebook.com/settings/?tab=applications.

If you want to imitate this on your own site you should read more on Facebook Applications at http://developers.facebook.com/docs/authentication/. You simply register a Facebook application, then plop the Facebook JDSK into your site to ascertain if a user has authenticated with your facebook application or not.

FB.getLoginStatus(function(response) {
  if (response.session) {
    // logged in and connected user, someone you know... customize the experience
  } else {
    // no user session available, someone you dont know... 
  }
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜