I'm trying to implement the new Facebook Checkbox plugin in my aspx page but I can't get it showing on the screen. This error is happening at client side but Frame is hidden.
Error:
Refused to display 'https://www.facebook.com/v2.9/plugins/messenger_checkbox.php?allow_login=true&app_id=*******....' in a frame because an ancestor violates the following Content Security Policy directive: "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>
Also, i have also white listed the domain but unfortunately not able to see it on my page. Suggest the best answer for get rid of this error
https://developers.facebook.com/docs/messenger-platform/messenger-profile/domain-whitelisting
Errors I fixed to get this to work:
Make sure the page is subscribed under the App Settings, under "Messenger Settings"
Make sure "origin" is the URL of the page where you are trying to render this and NOT the URL for the fan page. I feel a bit dumb but I did make this mistake.
Whitelist your domain to make sure you did not overwrite it. And get list of current white listed domains to make sure it is spelled correctly and that there is not a missing "www".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With