Fetch user email with C# Facebook SDK -
i fetch user's email using c# facebook sdk. how can so? i've tried code below, empty email. because somehow need ask more rights? if so, how do that?
facebook.facebookclient fbc = new facebook.facebookclient(user.mobileserviceauthenticationtoken); dynamic clientcredentials = await fbc.gettaskasync("oauth/access_token", new{client_id = facebookclientid,client_secret = facebookclientsecret, grant_type = "client_credentials",redirect_uri = "https://xxx.azure-mobile.net/signin-facebook"}); fbc.accesstoken = clientcredentials.access_token; fbc.appid = facebookclientid; fbc.appsecret = facebookclientsecret; string id = user.userid.replace("facebook:", string.empty); dynamic result = await fbc.gettaskasync(id + "?fields=id,name,picture,last_name,first_name,gender");
best regards tj78
you need gather email
permission in login url's scope parameter, otherwise not able receive email
field.
Comments
Post a Comment