Nakib Nakib - 27 days ago 13
PHP Question

Facebook App Canvas Showing Blank Page

i am trying to create facebook app but the canvas page is showing blank. I am working with localhost.

enter image description here

In my htdocs folder i have basic php file with following content

<html>
<head>
<title>Fb App</title>
</head>
<body>
<h1>Working....</h1>
</body>
</html>


In the console window i am getting following error

**[blocked] The page at 'https://apps.facebook.com/fooobaaar/' was loaded over HTTPS, but ran insecure content from 'http://localhost/': this content should also be loaded over HTTPS.
(index):37**

**event.returnValue is deprecated. Please use the standard event.preventDefault() instead.**


I guess this means i need https. Do i really need https for testing on localhost

Answer

Since all your content is in Facebook's iframe, and it's a different domain, you need SSL.

You could go to your Facebook account settings and turn off "secure browsing" which allows you to use Facebook via pure http. I do not recommend this, as you might forget to turn it on later and not even know that stuff does not work for your users.

For testing you can build your own frame (to get proper page size, for example) and mock the Facebook's authentication in your code.

With real Facebook you would need install stuff on some server anyway because other things won't work properly. Facebook's servers cannot contact "localhost" to send you any data, for example.

Comments