Cant use FBService or GetUserInfo

Aug 11, 2008 at 2:05 PM
Hi there,

I recently changed to the lastet v2.0 RC0 release candidate. My iframe application errors now in Visual studio. There appears to be no more FBservice feature or GetUserInfo - have these been removed?

For example:

Dim

 

user As String = FBService.GetUserInfo.FirstName

This no longer works at all and I cannot find any more reference to GetUserInfo. When I type FBService it isnt recognised at all.

Have they been removed from v2.0 and if so what are their replacements?

Thank you for any information in this.

 

Aug 12, 2008 at 11:28 PM
I'm wondering the same thing.  It seems to be removed - what is the new way to get the user info?
Aug 13, 2008 at 12:57 AM
...and the new User's_Guide.doc file still references GetUserInfo.  If it has been replaced, the documentation needs to be revised.
Aug 13, 2008 at 9:55 AM
Yes, hopefully the guys developing this project will expand on this for us. On a different note, does anyone acutally know when Facebook will pull the plug on the old profile, its a real pain trying to make your apps compatable for both atm.

Deeko
Aug 14, 2008 at 1:07 AM
I wonder if they are paying attention here.  Maybe this needs to be filed as a bug?
Aug 14, 2008 at 4:35 AM
here is a sample snippet using the new code to get user info and such:

using facebook;
public partial class pages_open_fbhome : facebook.web.CanvasIFrameBasePage
{
new protected void Page_Load(object sender, EventArgs e)
    {
        base.Api = FACEBOOK_API_KEY;
        base.Secret = FACEBOOK_SECRET; 
        base.Page_Load(sender, e);
       
         string fbuid = base.API.uid.ToString();
}
*this is a facebook.web.CanvasIFrameBasePage that extends a normal ASP.NET page, so "base" refers to properties found in the CanvasIframeBasePage class
Aug 14, 2008 at 3:10 PM
Cheers topeson, I was struggling with this too for some reason, and now I've read your code, it's blindingly obvious :)
Aug 15, 2008 at 1:43 AM

Wow.  Thanks for the tip.

It doesn't work in VB.  Issue here is that Facebook.Web.CanvasIFrameBasePage has two properties named api.

There's

public string Api

and

public API API

Since VB is not case sensitive, it tells me it's an ambiguous property.

I couldn't see either Api or API in object browser in a VB project.  But I could in reflector and in object browser in a C# project.

After opening the source and changing one of the property names in the CanvasIFrameBasePage class, it compiles ok.

 

Aug 15, 2008 at 1:46 AM

Filed a bug:

http://www.codeplex.com/FacebookToolkit/WorkItem/View.aspx?WorkItemId=11017

Aug 26, 2008 at 2:27 PM
with the CanvasFBMLBasePage, there is base.API and base.ApiKey. I guess this is the right way to do it though the documentation is still refering to base.Api to assign the key. I also don't have any idea how to get the User object with the new toolkit :S. User guide doesn't help much. Will try to fool around with it a bit to see if i can figure this new toolkit out.
Sep 4, 2008 at 2:35 PM
I am having the same problem as jlvillaraza. I used base.Apikey but there is no base.Page_Load event handler so this code won't compile. Any idea on when some updated and accurate documentation will be available.

using

facebook;
using facebook.Components;

public partial class Rosary : facebook.web.CanvasFBMLBasePage
{
private const string FACEBOOK_API_KEY = "--- my key --";
private const string FACEBOOK_SECRET = "-- my secret --";

    new protected void Page_Load(object sender, EventArgs e)
        {
            base.ApiKey = FACEBOOK_API_KEY;
            
base.Secret = FACEBOOK_SECRET;
            base.Page_Load(sender, e);
        }
}