Not able to create app for plaltform facebook canvas

127 Views Asked by At

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.

1

There are 1 best solutions below

6
CBroe On

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.