开发者

How to get user e-mail addressess that clicked like button for blog entries or pages with Facebook Open Graph Protocol?

开发者 https://www.devze.com 2023-02-12 06:43 出处:网络
I hav开发者_运维问答e implemented Facebook Open Graph Protocol Full Integration following the http://developers.facebook.com/docs/opengraph/ and http://www.websitedesign411.com/blog/facebook-open-grap

I hav开发者_运维问答e implemented Facebook Open Graph Protocol Full Integration following the http://developers.facebook.com/docs/opengraph/ and http://www.websitedesign411.com/blog/facebook-open-graph-protocol-full-integration-walkthrough.

How can I get user e-mail addressess that clicked the like button for certain blog entries or pages?


You can't. Access to the email address requires prompting the user for extended permissions. You can't get that information through a simple "Like" action. That would be a spammers dream! http://developers.facebook.com/docs/authentication/


I don't believe you can access a facebook user's email address just because they clicked on your Like button. What you will need to do is get the user to authenticate to your application using facebook connect (usually by clicking on that blue "Connect" button), and in the process you can prompt them to share their email address. Email is an 'extended permission' so you need to ask explicitly for it.

You can implement this authentication bit easily enough with the facebook javascript SDK: http://developers.facebook.com/docs/reference/javascript/

Once the user has authenticated to your application allowed access to their email you can can fetch their email address via the graph api:

http://developers.facebook.com/docs/reference/api/user/


The easiest way to communicate with folks who like your page is to post interesting messages on your page's wall leading them to your facebook app.

You then get them to authorize your app (with or without extended permissions).

Once authorized, you are able to communicate several ways like:

  • using livemessage http://developers.facebook.com/docs/reference/rest/livemessage.send/

  • create an event and add their user id to it.

BTW, the way to get their user ids is:

1) getting the object id of your page/url using https ://graph.facebook.com/?id={URL}

2) retrieving the user ids via https: //graph.facebook.com/{mypageid}/likes

0

精彩评论

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