I have a app ( web, ios and android ).I want to the create a Facebook canvas app where it will only show the first page of our web app.To achieve this.I created a Facebook canvas app in Facebook developer console.I filled the details which was required (Secure Canvas URL : https://example.com ,Mobile Site URL : https://example.com ) I am not sure what is secure canvas url meant so I put the link of my web app.But when open the canvas page ( https://apps.facebook.com/some_id).It is giving 405 Not allowed error.After digging I found out that Facebook is making a post request to my web app with a signed request ( not sure what it is ). How do I show my web page on facebook canvas page.Please explained to me how this things works and how can I achieve it.Thanks in advance.
Asked
Active
Viewed 124 times
3
-
Why are you creating a canvas app that just displays the first page of your web app? – WizKid Jun 16 '16 at 08:58
1 Answers
0
Facebook loads app into the iframe by making a POST request to your app URL. You typically get a 405 Not allowed
when your URL does not accept POST requests.
Many webspace providers have a setup where POST requests to “static” resources (such as .htm
/.html
files) are not allowed.
So you need to either change that in the webserver configuration (might be possible via .htaccess on an Apache; ask your server admin/support if you’re not sure), or you need to use a different “file type” for your app’s base URL that you want to load into canvas - for example, if PHP is available, the configuration usually allows POST requests to PHP scripts by default.

CBroe
- 91,630
- 14
- 92
- 150
-
what is Secure Canvas URL and signed_request which is send along with POST request. – nandanself Jun 16 '16 at 09:13
-
Secure Canvas URL is the HTTPS URL of where you host your app. And the signed_request is a parameter send along on the additional load of the app into the iframe, containing some additional information.https://developers.facebook.com/docs/games/gamesonfacebook/login#parsingsr, https://developers.facebook.com/docs/reference/login/signed-request – CBroe Jun 16 '16 at 09:15
-
@CBroe, hey, my server is built on Django, and I am processng the POST request to render a static html page. When I make the request from `Postman REST Client`, the web page is rendered whereas in Canvas all I get is a blank page. Even inspecting that shows empty – Sagnik Sinha Jun 20 '16 at 10:50
-
Your URL is a HTTPS one, and you do have a valid SSL certificate for it? – CBroe Jun 20 '16 at 10:51
-
yes, the URL is HTTPS, but no apart from that, there isn't anything else – Sagnik Sinha Jun 20 '16 at 11:02
-
So can you visit the URL directly in your browser, without any warnings regarding HTTPS/the certificate? – CBroe Jun 20 '16 at 11:12