/ .net

Facebook C# SDK posting on wall with ASP.NET MVC 5

In my previous post: Facebook and Google login with C# and ASP.NET MVC 5 I explained how to login easily with Facebook or Google. In this one I will extend the functionality in order to make your application post on the user’s Facebook wall (it’s really call feed).

You will need:
– Facebook developer account
– ASP.NET MVC 5
– Nuget
https://www.nuget.org/packages/Microsoft.Owin.Security.Facebook/
https://www.nuget.org/packages/Facebook.Client/

app_start/Startup.Auth.cs

FacebookBackChannelHandler.cs

ChallengeResult.cs

controllers/oauthcontroller.cs

controllers/postcontroller.cs

If you need to make you post more attractive you have more fields available:
https://developers.facebook.com/docs/graph-api/reference/v2.8/user/feed#publish