Facebook messenger checkbox not displayed

I am trying to implement a new Facebook Checkbox plugin on my aspx page, but I cannot show it on the screen. This error occurs on the client side, but the frame is hidden.

Error:

Displayed ' https://www.facebook.com/v2.9/plugins/messenger_checkbox.php?allow_login=true&app_id= ******* ....' in the frame because an ancestor violates the following Policy Directive Content Security: "frame-ancestors https://www.facebook.com "

What i have done so far:

<script> window.fbAsyncInit = function () { FB.init({ appId: '---MSGAPPID---', xfbml: true, version: 'v2.9' }); }; (function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) { return; } js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk') ); </script> <div class="fb-messenger-checkbox" origin="---Orgin url ------" page_id="--Pagelivefacebookid--" messenger_app_id="--Mssgappid--" user_ref="randomnumber" prechecked="true" allow_login="true" size="large"> </div> 

In addition, I also added a domain whitelist, but, unfortunately, could not see it on my page. Suggest a better answer to get rid of this error.

 https://developers.facebook.com/docs/messenger-platform/messenger-profile/domain-whitelisting 
+5
source share
2 answers

The errors I fixed to make this work:

  • Make sure the page is signed in the application settings, in the "Messenger Settings" section

  • Make sure that "origin" is the URL of the page you are trying to do this on, and NOT the URL of the fan page. I feel a little stupid, but I made this mistake.

  • Return your domain to make sure you have not rewritten it. And get a list of current white domains to make sure they are spelled correctly and that there is no "www".

+1
source

You must provide White Domains in the Messenger Platform fb page settings

page setting

0
source

Source: https://habr.com/ru/post/1268805/


All Articles