May 4, 2010
I was recently asked to help out on a development project to pull through information from Facebook to a .NET website. I thought “this won’t be too hard, it’s easy in PHP”, so happily agreed to do the work.
Now, there are dozens of examples on how to do this (and to get the basics, Google has all the answers), but not one of them outlines what to do if you need to bring back any information that requires special permissions (in my case, email). As the Facebook API is a little bit erratic, I have published this code to hopefully help a few people out.
The code below is the full example you can use for yourself. Just remember to create your own Facebook application first (there are plenty of examples knocking about including here).
If you want to see this working, you can have a play here.
Hope this helps!