This project is read-only.

Complete newbie

Nov 24, 2011 at 12:03 AM

Hi, I am a complete newbie. I am following the topics relatively well, but I don't know where to put the snippets of sample code you have in your tutorial within the ASP sample app. Do you have all your code snippets built into a working sample?

Nov 25, 2011 at 11:23 PM

Which snippets are you not sure about? What kind of projects are you trying to write? I think it would be easier if you asked specific questions than for someone here to provide a lot of information which isn't relevant to your needs.

Nov 26, 2011 at 4:17 AM

Thank you for your reply. Is there a working sample of any type at all that uses this API?

Nov 26, 2011 at 11:24 PM

It's always that first kick-off point that's the hardest, isn't it?

OK, go to this project homepage. Click on the link provided for Getting Started.

That puts you into one of the tutorials, for a Canvas app.

In the right-side Navigation, go to Step 1,2,3,4.  Just read through them.

On the Step 4 page you'll find a link to an online app, and *ding* a download link.

You can cut to the chase just by going to the downloads page and look at the bottom of the page for downloadable zips, but the tutorial really does step you through the requirements.

In my limited experience there are only a few basic requirements (for a Canvas app).  You'll see details for all of this in the tutorial and sample code, but here is what it takes in a nutshell:

  1. Get the config file XML in place, set vars as described in the tutorial.
  2. Set a reference to the lib and add your Using/Import statements for FGT namespaces.
  3. Your page derives from CanvasPage not Page.
  4. Your Page_PreInit sets vars RequireLogin=true, ExtendedPermissions="whatever,you,need", and CheckExtendedPermissions=true (that's a start anyway, change as required later).
  5. Page_Load checks if Api==null and if it is, execute RedurectToFacebookAuthorization() and return false. This is the first page a user will see that asks them to approve the app with the permissions you defined in ExtendedPermissions.
  6. If you have an Api var != null, you're now in your app!  At this point use standard event handling. In Page_Load for example, you might want to get the user:
    User thisUser = new FB.User("me",Api.AccessToken);

That's it. You're in from there.

Please post here with your experience so others will benefit.