fb:redirect next value prefixed with callback URL after sendRequest

Aug 1, 2007 at 5:55 AM
Hi again

Thanks for all your help so far. I am having a problem with fb:redirect after doing a sendRequest. The sendRequest works and returns a URL to confirm the user. I append this URL with a parameter "next" whose value is the urlencoded URL I want my user redirected to after they confirm the request. As follows:

String nextURL = HttpContext.Current.Server.UrlEncode("http://apps.facebook.com/myapp/Invite.aspx?success=true"));
String urlToSend = FBService.SendRequest(invitation, friendsToInvite, "ApplicationName", new Uri(imageUri), true);
Response.Write("<fb:redirect url=\"" + urlToSend + "&next=" + nextURL + "\" />");

The problem is that the user is not sent to the nextURL - instead they are sent to my application callbackURL appended with the nextURL.
eg as follows where "http://www.mycallback.url/web/" is my app callback url.
http://www.mycallback.url/web/http://apps.facebook.com/myapp/Invite.aspx?success=true&sent=1&auth_...

any ideas what i have got wrong? ASP.NET is not my native tongue and little things stump me sometimes :)

Thanks for your time
Mariellen
Aug 1, 2007 at 9:53 PM
That seems to just be the way it works. I'm not sure if that's a bug or not, since it seems to be different than the functionality of next= after login. In any case, you can work around it by making the url something like:

Response.Write("<fb:redirect url=\"" + urlToSend + "&next=" + Server.UrlEncode("?next=" + nextURL) + "\" />");

Then on your callback page, look for the next= querystring param, and redirect to the url it contains.
Aug 31, 2007 at 9:41 PM
Did this work for you. I am having the same problem. The invitation is sent, but the user is redirected to my callback page. First I tryed changing my call back page to apps.facebook.com/myapplication, but it doesn't look like they allow that. so then I figured I would redirect to the proper page. It kind of works. The page does redirect where I want it to go, but I keep on getting a "HTML tag not supported: "html" error. I'm not really sure why this is happening because I took all of the html code out of the default page. All it does is check for a url to redirect to, or redirects to apps.facebook.com/myapplication.

Does anyone have any suggestions?