Profile tab page - how do I get the current UserId?

Nov 12, 2008 at 1:54 PM
On my profile tab page, I'm trying to obtain the userId of the current facebook user, so I can load user-specific content.  How do I get that?  The code below returns a blank UserId.  Thanks!
   
in Page_Load of profile tab page...
 
Dim mFbSvc As Facebook.Components.FacebookService = New Facebook.Components.FacebookService()
mFbSvc.ApplicationKey = "xyz"
mFbSvc.Secret = "123"
mFbSvc.IsDesktopApplication = False
Dim userId As String = mFbSvc.UserId ' this is empty...
     
Nov 13, 2008 at 11:03 AM

By profile tab page i assume your speaking about the "Application Tab", facebook post information to your page , so on page load i do this in C#

fbUserId = Convert.ToInt64(Request.Form["fb_sig_profile_user"]);

this get the userid of the "Owner" of the application tab.

 

Nov 13, 2008 at 5:46 PM
That did it, thanks!
Nov 25, 2008 at 9:00 AM
Hi,

Thanks for the tip works fine. Then I was able to display the name and so on of the user with some fbml. But now I would like to know if we can access the friends of the guy who installed the profile tab who use my app? This was working few weeks ago but not anymore :(

Thanks for your help!
Nov 25, 2008 at 9:50 AM
Sorry I found the answer sometimes it helps to ask the question to solve it ^^

Friends can be found here: Request.Form["fb_sig_friends"] :)
Nov 12, 2009 at 12:30 PM
DevWannabe wrote:

By profile tab page i assume your speaking about the "Application Tab", facebook post information to your page , so on page load i do this in C#

fbUserId = Convert.ToInt64(Request.Form["fb_sig_profile_user"]);

this get the userid of the "Owner" of the application tab.

 

 Hi,

 I am trying to get userid in the application tab but when i click on my application i am getting error saying.

fb:redirect: redirect forbidden by flavor TabFBMLFlavor... 
what is the fbUserId here?
What could be the issue. Please help me regarding this.
Thanks in advance.