CanvasPage not working in version 1.24.x

Mar 29, 2011 at 8:45 PM

I keep receiving the error "Cannot find Facebook POST data as expected. Make sure you're viewing this page in a Facebook Iframe Application." when using 1.24.anything.  I tried downloading one of the older versions but they throw an exception stating they cannot load.  Can it be related to the Facebook App settings?  I have followed the tutorial and its just not working.

Coordinator
Mar 30, 2011 at 4:09 AM

You must use the application under the Facebook iframe, i.e. your browser address MUST be pointed to an address like http://apps.facebook.com/xxxxx .

Apr 10, 2011 at 12:29 PM

Hi, I'm having the same problem.

Yes I'm trying to reach the application with http://apps.facebook.com/myapp..  the same error is shown inside the iframe under facebook.

It happens both for iframefbapp2 sample project and a new page I created with new version of the graph toolkit.

Do I need to wait for Facebook to cache the application? any suggetsion?

thanks

Apr 10, 2011 at 7:23 PM

I don't know how, it's resolved some how. (Facebook cache problem or smthing?)

Inherit from Canvas page, don't forget to have this line:

        protected void Page_PreInit(object sender, EventArgs e)
        {
            RequireLogin = true;
            ExtendedPermissions = "publish_stream, user_photos";
        }

also use "!IsPostBack" for the code you plan to add to pageload.

Kayson, thanks for SDK by the way, it looks very promising.

Coordinator
Apr 12, 2011 at 4:31 AM

The Facebook platform is actually poor constructed and very unstable. I sometimes encounter these "random" errors from Facebook as well. A few hours later it's back to normal again. Unfortunately there is nothing developers can do, which is pretty frustrating.

May 11, 2011 at 4:52 PM

Hi there,

I am having the same problem with version 1.3, I have the code Gkaya suggest in my PreInit event, I set my app as an Iframe app and put http://apps.facebook.com/myapp/ as destination, but it is not working.

Is anyone still having this issue???

Thank you very much.

May 11, 2011 at 5:38 PM

Hi, i found the error is happening here:

                string SignedRequest = HttpContext.Current.Request["signed_request"];
                if (SignedRequest == null) {
                    throw new FacebookException("Cannot find Facebook POST data as expected. Make sure you're viewing this page in a Facebook Iframe Application.");
                }

My question is, what signed_request is it waiting for??? what if you already have the app authorized or you are already connected to FB??? Is this a normal request???

Just asking, thank you very much again... ^^

Coordinator
May 11, 2011 at 8:17 PM

"signed_request" is a vital piece of information the library must have in order to do all the work. It's the core of the Graph Api in Canvas Apps. If the library cannot obtain this data the rest of the process cannot continue. You can check the technical details in the Facebook Developer Documentation.

There are three possible causes that match your description of the error.

1. The Facebook Development Platform has a bug.

2. The POST data sent by Facebook somehow cannot reach your server.

3. The "signed_request" and OAuth 2.0 settings are turned off in the Developer settings of the app. Newer apps do not have this option, but older apps do.

May 11, 2011 at 8:31 PM

Thank you very much Kayson, it was the 3rd reason... it is working now... =)