ruby on rails - Facebook messenger send_to_messenger gives issue -


hello using gem 'facebook-messenger' , follow steps same given in gem. requirement add send messenger button in app had included following code

<script>  window.fbasyncinit = function() {     fb.init({       appid      : 'app_id',       xfbml      : true,       version    : 'v2.6'     });   };   (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=page_url   page_id=page_id   messenger_app_id=app_id   user_ref= <%= @order.number%>   prechecked="true"    allow_login="true"    size="large"></div>   

it gives me error

refused display 'https://www.facebook.com/v2.6/plugins/messenger_checkbox.php?allow_login=true&app_id='app_id'&channel=https%3a%2f%2fstaticxx.facebook.com%2fconnect%2fxd_arbiter%2fr%2fxbwzv5yrm_1.js%3fversion%3d42%23cb%3df379bc53d47b1%26domain%3d3aa1d074.ngrok.io%26origin%3dhttps%253a%252f%252f3aa1d074.ngrok.io%252ff2ea378cba3d818%26relation%3dparent.parent&container_width=1273&locale=en_us&messenger_app_id=219206268600034&origin=https%3a%2f%2fwww.facebook.com%2fmy-test-716683128523791%2f&page_id='page_id'&prechecked=true&sdk=joey&size=large&user_ref=s906106687' in frame because ancestor violates following content security policy directive: "frame-ancestors https://www.facebook.com".

please guide me how resolve error.

adding answer in case else comes across in future.

you're getting csp error , need whitelist domain. covered here


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -