Facebook C# SDK Canvas Authorization

I have an iFrame Facebook application. I am using the Facebook C# SDK (version 6.0.10.0), Facebook and Facebook.Web (version 5.4.1.0') libraries.

As i get some help from stackoverflow and some other sites Facebook C# SDK Authorization Problem http://forum.ngnrs.com/index.php/topic,199.0.html

i coded as

 protected void Page_Load(object sender, EventArgs e)
    {
            fbApp = new FacebookApp();
            authorizer = new CanvasAuthorizer(fbApp);
            authorizer.Perms = requiredAppPermissions;
            if (authorizer.Authorize())
            {
                  //user authorized
            }
            else
            {
                  //user  not authorized
            }
    }

but in the line "authorizer = new CanvasAuthorizer(fbApp);" it gives ma a syntax error as Error 14 The best overloaded method match for 'Facebook.Web.CanvasAuthorizer.CanvasAuthorizer(Facebook.Web.FacebookWebContext)' has some invalid arguments.

In Facebook C# SDK there is no clue about the syntax change; Please help ?

Answers


For a Canvas app, Facebook does a post request to your Canvas Url that you specified in your Application settings. In the post request, you get the signed_request parameter. All you have to do is parse that parameter using the Facebook API method and it will give you the access token which is used to make further calls.

Here is a brief tutorial about the same. This was written with ASP.NET MVC 3.0 in mind. However you can use most of the code for classic ASP.NET too.

http://theocdcoder.com/tutorialcreate-a-facebook-canvas-app-using-asp-net-mvc-3/


Need Your Help

Titanium - Change imageview using picker

image mobile replace imageview titanium

I am trying to change an imageview to a new image based on a "change" event. When i attempt this event with the current code, i get a an error- "invalid image type. expected either TiBlob or TiFil...