Facebook C # SDK Get current user

I am working on a Facebook application. Not a website.

I am trying to use the Facebook SDK C # and am trying to get current information about the user and the request of the current user. How to do it?

In addition, when I try to use the application, it asks to add the application, asking for permission to access data, how to do it?

Are there comprehensive examples of these things?

+2
source share
2 answers

If you are working with .NET 3.5, this will work:

var facebookClient = new FacebookClient(FacebookAccessToken); var me = facebookClient.Get("me") as JsonObject; var uid = me["id"]; 
+2
source

You need an access token. After you receive the access token, request me

 var fb = new FacebookClient("access_token"); dynamic result = fb.Get("me", new [] { fields = "id" }); var userId = result.id; 
0
source

All Articles