Send Invitation using IFRAME

Jul 10, 2007 at 7:21 PM
Edited Jul 10, 2007 at 7:21 PM
So what does everyone think is the best way to send the user to the Redirect Url returned from the Send Invitation when using the IFRAME canvas?

I could javacript in the redirect. But then I need the Invitation confirmation page to redirect back to the correct IFRAME page.

Does anyone know if there is a smaller (no side bar) version of this page available for redirection?

Thanks!

-Andy
Jul 13, 2007 at 12:16 PM
Am I missing something really easy on this? Or is somebody else having the same problem?
Jul 17, 2007 at 9:57 PM
Anyone?
Coordinator
Jul 18, 2007 at 2:57 PM
Andy- I was hoping someone would help you out. But, looks like that is not happening.

This is tough, I don't know of a good solution. I will try to take sometime to play around. I don't think there is an alternate version. I think the only way is to have the invitation send them back to a page on your site. You could store a cookie or something marking where to redirect them and use the page they are returned to read the cookie and redirect them back to their place in your iframe.

I will see if I can get that to work in the next day or 2.
Jul 18, 2007 at 5:01 PM
You can specify an &next= value when you send the user to the confirm url. So, you would send the user to

refurl & "&next=" & server.urlencode("?forward=somepage")

or refurl & "&next=%3fforward%3dsomepage"

or something, and facebook will append that to the url when they send the user back to your confirmation page URL. On the confirmation page, redirect to whatever is in the forward querystring variable (plus .aspx)
Jul 18, 2007 at 5:22 PM
I see someone beat me to it while I was experimenting, but I can canfirm the &next= tip above.

For instance, if url is what's returned from the sendrequest call, you could use:

Response.Redirect(url + "&next=" + Server.UrlEncode("?next=http://apps.facebook.com/myapp/mycanvaspage.aspx"));

Then look for the next= querystring on your callback page, and redirect them to the url if it is present.
Coordinator
Jul 18, 2007 at 6:07 PM
Cool. Nice tips.

Andy does that solve your problem?
Jul 18, 2007 at 7:24 PM
Edited Jul 18, 2007 at 7:26 PM
Just to make sure I follow on this...

This will be the page they comeback to when they are done confirming the invitation.

If that is the case. What I am looking for is a "minimized" version of that confirmation page (the page they go to before going to the page referenced in the &next page.)

My problem is that the Confirmation Page ends up being in the IFRAME of facebook. So you end up seeing the enire facebook site inside the iframe of the entire facebook site.

Or am I misunderstanding what you wrote?

Maybe this is the solution if I use Javascript to break out of IFRAME and then have the &next page bring it back to IFRAME? Is that what you mean?

Jul 18, 2007 at 7:52 PM
Oh, I see what you're saying (because I just got to that point in building my app, too)... Yeah, I think the solution is going to be to use js to break out of the frame when sending them over to the confirmation page, then using the &next param to get them back to where you want them.

Note that &next is not where they will go next directly from facebook - they always go to your callback page, which then has to redirect them to the right place, based on the param you passed back.
Jul 27, 2007 at 6:51 PM
Hopefully this isn't considered necroposting, but I figured I'd post how I ended up handling this, since it was never really answered... Instead of simply doing a redirect, I ended up using the javascript code that the base pages use to break out of a frame to do it myself, like so:

string url = FBService.SendRequest( ... );

if (url.Length > 0)
{
Response.Write("<script type=\"text/javascript\">\nif (parent != self) \ntop.location.href = \"" + url + "&next=" + Server.UrlEncode("?next=mynextpage.aspx") + "\";\n</script>");
Response.End();
}

Hope that helps!
Jul 27, 2007 at 8:51 PM
i am trying to send request using SendRequest() function and it's not working.

fbService.SendRequest("<fb:req-choice url=\"http://apps.facebook.com/newsfeedap/\" label=\"News Feed (CityNews)\" ></fb:req-choice>", toList, "event", _img, false);

Thanks,
Jul 30, 2007 at 8:38 PM
Edited Jul 30, 2007 at 8:41 PM
i got sendRequest working, but now the issue is when the user click on the button from there invite to add the application it display hole facebook template within IFrame. one more thing after clicking on confirm button i loose facebook frame. i want the users to go back to my application. i try confirmeURL + "&next=", but not working.

Thanks,

apsa
Jun 12, 2008 at 3:53 PM


apsa wrote:
i got sendRequest working, but now the issue is when the user click on the button from there invite to add the application it display hole facebook template within IFrame. one more thing after clicking on confirm button i loose facebook frame. i want the users to go back to my application. i try confirmeURL + "&next=", but not working.

Thanks,

apsa



I'm having this same issue.  Is there a resolution to this?  When a user confirms or accepts the invitation, the entire facebook template loads in the small frame asking to log in to my application.  Whats up with this?