Post to facebook on behalf of the user using access token in xamarin.forms

EhudonEhudon ILMember

I build Xamarin.Forms App using this tutorial:

docs.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-xamarin-forms-get-started and I choose .NET back end.

and also implement authentication using this: docs.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-xamarin-forms-get-started-users

while choosing Facebook as my authentication provider.

My question is, how can I post on facebook on behalf of the user using the access token that I got from the "MobileServiceUser"? I saw that it has a property called "MobileServiceAuthenticationToken" and I tried to use that token as a access token and create a FacebookClient using the Facebook sdk and that code:

FacebookClient fb = new FacebookClient(user.MobileServiceAuthenticationToken); string myMessage = "Hello";

fb.PostTaskAsync("me/feed", new { message = myMessage });

but no luck , can anyone help and see my mistake ?

Sign In or Register to comment.