I am working on a Facebook application And I am offering the user to invite his friend to the application using the C# SDK. as shown in Facebook documentation
My p
In case if you are using http://facebooksdk.codeplex.com/ with MVC3 at the app main page controller you should provide redirection for non-authorized users:
var fbWebContext = FacebookWebContext.Current;
if (fbWebContext.IsAuthorized() && fbWebContext.UserId > 0)
{
try
{
var fb = new FacebookWebClient(fbWebContext);
dynamic result = fb.Get("/me");
}
catch (FacebookOAuthException)
{
var redirectString = string.Format("https://graph.facebook.com/oauth/authorize?client_id={0}&redirect_uri={1}&type=user_agent&display=page&scope={2}",
Facebook.FacebookApplication.Current.AppId,
FacebookWebContext.Current.Settings.CanvasPage,
"email, publish_actions"
);
Response.Redirect("redirectString");
}
}