I keep seeing the facebook logo with a link that reads "Go to Facebook.com" in my canvas app while screens are loading. Eventually the app loads fine, but what is this and how can I avoid it?
It's there because you are doing a "frame level" redirect when you are jumping to Facebook for authentication (i.e. you are using something like header('Location:xyz') in PHP or location.href=xyz in javascript). You need to do a page-level redirect, which is why the doc sample code uses top.location=xyz javascript calls. Because you are not breaking out of the iframe, Facebook is putting up the intermediate link screen to do it for you.
self.location.href inside iframe instead of header()
Related
I've provided my canvas app with all required for publishing actions to Facebook. After I publish an action I have a message like "John made an action over {SomeObject}" in my timeline. Everything works OK but the {SomeObject} i click opens in a window, not in facebook iframe where my app usually works. The URL of this link is rendered like this:
https://www.facebook.com/connect/uiserver.php?app_id={my_app_id}&method=permissions.request&redirect_uri={my_object_url}&response_type=code&display=page&auth_referral=1&fb_private_mode_enc={some_text_string}
What should i do to make my clicked object open in facebook iframe, not window? Can i somehow change display=page to display=iframe in this URL?
Thanks!
I've been having this problem too - I'd like to be able to direct a user straight to my canvas app. Added to this, unless the meta in {my_object_url}'s HTML lines up with what Facebook expects to see, the link resolves to a "this app is having a problem" dialog.
A possible workaround for you, not so much a 100% answer: allow the redirect, but in the meta of the page being redirected to, do an HTML refresh back to the app canvas? This would redirect users back to the app.
If you needed to direct them to a specific page of the app, you could use an app_data signed request addition to the canvas-redirect URL.
Hope this helps. Not a silver bullet though.
PG
I had links that worked before timeline, and since we moved to timeline, they don't. We are using the Facebook iFrame for our content.
What is going on? When we click on the link, it seems like something is blocking the browser from changing the page.
http://www.facebook.com/Activis?v=app_179997328701001
Edit : I'm still investigating that problem; One thing I should mention is that only links that go to another Facebook App don't work. The ones that go to something else than Facebook (A blog, Twitter and Linkedin) work fine.
TommyBs Wrote:
Is the target of the links the same frame? I find sometimes that facebook doesn't let you redirect to an iframe of facebook. E.g - Make sure you either set the link to target="_top" or make sure it is a full url of an app and not the app on facebook. Otherwise you're basically loading an iframe of facebook, with an iframe of your app within the existing iframe
Yup, putting a target="_top" on my links worked. Thanks!
Okay, allow me to say first off that I am working on developing my first FB app/page tab at the moment. I'm not looking for anything fancy yet, just workability.
That being said, I have managed to create a FB app that loads from the hosting requested, and displays it under the app page. I have also made it so that I can add it as a page tab to FB pages. What I am having an issue with is that clicking on the page tab for the app, it does not show any content in the iframe on the page, though it shows on the canvas page for the app.
So, my question is, do you have any ideas as to why it might be showing on a canvas iframe and not the page tab iframe? I am currently guessing that it has to do with how the signed request is processed, but am not completely sure. I am using the PHP SDK for FB given here: https://github.com/facebook/php-sdk/ for the FB-related functions, and am tracing through that currently for where I might be going wrong.
Any help is appreciated. Thanks. =)
I had the same problem and was able to solve it by providing different (http vs https) URLs for the secure and non-secure canvas and page tab URLs. Just remove post the non-secure URL for the non-secure canvas/page tab URL fields. I believe this is because Facebook doesn't check to see if the user has secure browsing turned on until after they have logged in.
You could try to change the order of appear of the app tab; it worked for me.
I am making a little Facebook app that includes an image browser at the bottom, when the user clicks on one of the images in the browser I want to redirect the user to edit the image but stay inside the Facebook frame. I am doing my redirect like this (I read on another page that this should work):
top.location.href = newUrl;
Sadly this just redirects to the newUrl outside of the Facebook frame, how can I make it do the redirect inside the Facebook frame? A solution using Javascript would be the best but if I needed to make the call from php that could work too.
Try using self.location.href instead.
i used to use <fb:serverfbml> and to parse it FB.XFBML.parse().
when i switched to FB.ui, it is very effecient. but as far as i understand, for "apprequests" method, i have to display mode available: pop up or dialog(iframe)
pop up opens in a new browser window. diolog opens iframe window in the same window
so i need to know, if it is possible to render FB.ui result as a part of html, as i can do in <fb:serverfbml>
moguzalp
note: i do a work around doing an rendering FB.ui result in iframe that a create. but it seems not a good idea
Don't use fb:serverFbml, Facebook has made it very clear they are phasing this technology out and are encouraging developers to re-write their applications as iframes. Facebook will continue to improve the FB.ui({method:'apprequests',...}) code.
One issue developers have raised about FB's on page solution for other FB.ui dialogs is the placement on the page. For pages that are more than a screenful, the dialog often appears in an illogical location. The Popup, if used correctly as part of a click event, will display for the majority of users.
I've also created a post illustrating the use of the new apprequests method
http://af-design.com/blog/2011/02/17/using-facebook-requests-to-promote-a-website/