setRefHandle return?

Jul 16, 2007 at 3:35 PM
What should SetRefHandle return? I can't find anything in the wiki documentation on it. It keeps returning 1 for me, and I assume that's good, but nothing is ever set when I use <fb:ref handle="myhandle" />
Jul 18, 2007 at 2:36 PM
so you are saying you used setRefHandle and created a handle named myhandle to some static FBML. But, when you put fb:ref <fb:ref handle="myhandle" /> on your page. Nothing shows up?

Can you post your syntax for calling setRefHandle (including the url that you are using)? 1 should indicate a successful a handle creation.
Jul 18, 2007 at 5:05 PM
Ignore this thread - I updated the Facebook.dll, but not Facebook.WebControls.dll, and something went awry - now I'm getting absolutely nothing returned, which should make it easier to debug (now that it's not returning 1)
Jul 18, 2007 at 5:07 PM
Strike that, it's not returning nothing, I just forgot to view my source, lol. It's returning "Unknown Method" - any idea why?

<?xml version="1.0" encoding="UTF_8"?>
<errorresponse xmlns="" xmlns:xsi="" xsi:schemaLocation="">
<errormsg>Unknown method</errormsg>
<request_args list="true">
Jul 18, 2007 at 6:18 PM
Can you try it again?

I just added a call to FAcebookService.SetRefHandle in my app and it seemed to work fine (and returned "1")

Let me know.

Sep 19, 2007 at 4:46 PM
I'm using version 1.3 of the Facebook Developer Toolkit and I'm trying to get the SetRefHandle to work... So far, nothing.... But I notice on this thread you guys are saying a response of 1 is successful, well it isn't.

The error codes are:

1 An unknown error occurred. Please resubmit the request.
2 The service is not available at this time.
4 The application has reached the maximum number of requests allowed. More requests are allowed once the time window has completed.
5 The request came from a remote address not allowed by this application.
101 The api key submitted is not associated with any known application.
102 The session key was improperly submitted or has reached its timeout. Direct the user to log in again to obtain another key.
103 The submitted callid was not greater than the previous callid for this session.
104 Incorrect signature.
Oct 25, 2007 at 6:53 PM
hey all,

where can i get version1.3, from this website i can only download v 1.2.

Oct 25, 2007 at 8:06 PM
There's no official release for 1.3 yet, but you can get the latest build (which will eventually become 1.3) from the source control tab. The new release should hopefully come out in a couple of weeks, once some other things get fixed.
Oct 26, 2007 at 3:47 PM
thanks for update.

is that below issue fixed...i am having same issue
this issue was posted by sara under issue tracker section and now it's closed. i am not sure if this was fixed.

I tested my app in Firefox and it works fine. If I use IE (6 or 7) mostly I have issues in calling my app from facebook. However it does work rarely from IE also. My first page keeps reloading even if I click links that are suposed to take me to other pages.

I have a few links in my first page of App. No matter what link I click, only the first page reloads. I have a submit button in the first page and clicking this should update my database. When I run into this reload issue, if I click this button it ends up reloading the first page and throws error exactly on the line _fbService.CreateSession as below.

if (!String.IsNullOrEmpty(authToken))

When this reload issue is not existing clickin gthis button works fine and the DB get updated. Also in Firefox clicking this button is fine and no reload issue also. User could navigate to other pages by clicking any link in Firefox browser.

Can someone please reply?

Oct 26, 2007 at 4:34 PM
Hmmm, I'll look into it. It was closed mainly because I was trying to get rid of old issues that I thought were outdated and that weren't issues anymore. I guess this one might still be a problem, so I'll find out what's going on and get back to you.
Oct 26, 2007 at 4:45 PM
apsa, could you post some information on how to reproduce the bug on the issue page ( I can't reproduce it here - my test app works the same in Firefox and IE, and I'm not running into any problems. Have you been able to get any links to work in IE at all? Does there seem to be something signficant about links which work and links which don't?

I could use some more details overall, like are you using IFrame or FBML, what the addresses for your links look like. I could especially use the content of the error message you're seeing. Just telling me that an error is thrown doesn't tell me a whole lot.
Nov 2, 2007 at 5:09 PM
sorry for late replay. my hard drive is burn and i can't recover anything.
i had iFarame app. below is code that i used on my calling page.

Facebook.Components.FacebookService _fbService = new Facebook.Components.FacebookService();

_fbService.ApplicationKey = "YOURKEYHERE";
_fbService.Secret = "YOURSECRETHERE";

_fbService.IsDesktopApplication = false;

string sessionKey = Session"Facebook_session_key" as String;
string userId = Session"Facebook_userId" as String;

string authToken = Request.QueryString"auth_token";

if (String.IsNullOrEmpty(sessionKey))
sessionKey = _fbService.SessionKey;
userId = _fbService.UserId;
if (!String.IsNullOrEmpty(sessionKey))
_fbService.SessionKey = sessionKey;
_fbService.UserId = userId;
else if (!String.IsNullOrEmpty(authToken))
Session"Facebook_session_key" = _fbService.SessionKey;
Session"Facebook_userId" = _fbService.UserId;
Session"Facebook_session_expires" = _fbService.SessionExpires;
Response.Redirect(@"" + _fbService.ApplicationKey + @"&v=1.0");

i done some debuging and found that session key was allways null from session and facebook service and redirect to loging page, since your already loged in facebook redirect to your canvas page which is default.aspx.
Nov 2, 2007 at 5:25 PM
i added for the login redirect so it redirect back to the correct page.

Response.Redirect(@"" +
FACEBOOK_APPKEY + @"&v=1.0" + @"&next=" + Request.FilePath.ToString().Replace("/facebookapp/", ""));
(change facebookapp with the name of your folder because it returns a full path not a dynamic path.

I 2 am having all sorts of problems with ie. This will sort the redirect problem but not the reason why sessions are dying..... any ideas?
Nov 2, 2007 at 7:26 PM
Ouch. Sorry to hear about your hard drive, apsa; that really sucks.

I copied and pasted the code you posted into a new page on a new project, put in my API key and secret, and it still works fine for me in both IE 7 and Firefox (I don't have IE 6, so I can't test that without doing a lot of uninstall/reinstall nonsense). I even called _fbService.GetUserInfo() at the end of the code and used the information to print the user's name to the page, which also worked in both browsers.

Do you possibly have cookies disabled in IE? That would cause the session to not work, which from what you tell me sounds like it's part of the problem. Also, does this happen every time you go to a new page in the app in IE, or does there seem to be any pattern to when it does or does not happen? One thing I've noticed is that the session from Facebook seems to die sometimes after about 15 minutes, but it sounds like you're having problems even when the session is not nearly that old.

Just to reiterate to make this clear, you log in to your application, which takes you to the first page. You click on a link which attempts to take you to the second page, but then you get redirected to the login screen, and after you login you get sent back to the first page. Is that correct?

confused1234's code takes care of the redirecting to the correct page after a login - the important thing is to set the "next" parameter whenever you redirect to the login page. I'm still not sure why you can't get the session key from the session on that second page, though. That doesn't make any sense to me. Like I said, check if your cookies are disabled or something like that, and let me know if you find anything else.