PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, January 6, 2022

[FIXED] Facebook App Canvas Showing Blank Page

 January 06, 2022     canvas, facebook, facebook-apps, facebook-php-sdk, php     No comments   

Issue

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


Solution

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.



Answered By - Milan Babuškov
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing