Facebook edge.create event doesn't fire like a box

I had a page with a simple Facebook button, and I needed to know when the user liked the page, so I used the edge.create event to do this, everything worked fine. Now I need to add the Box plugin to the page as a facebook client page, and again I need to get a notification when someone clicks the type button. However, the subscription event never fires. Any idea what could be the problem? I am using xfbml code to add a type field.

+6
source share
2 answers

This seems to be a mistake. Here is a link to official reliable sources:

http://developers.facebook.com/bugs/310763168934515

And my jsFiddle is here to demonstrate: http://jsfiddle.net/dmcs/3D2GD/1/

EDIT

I have found a solution!

At first I put my code in my own domain, not jsFiddle, in order to test better, however my first attempt failed, as if the code was still on jsFiddle. Therefore, I am more worried about the situation.

Then, to configure the application that I specified, I went in and pointed the WebSite url to https://developers.facebook.com/apps/{APP_ID}/summary

Here is my code

 <html> <head> <title>Like Box example</title> </head> <body> <div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init({ appId: '{APP_ID}' }); FB.Event.subscribe('edge.create', function(response) { alert('You liked the URL: ' + response); }); }; (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; //js.async = true; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId={APP_ID}"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); </script> <div class="fb-like-box" data-href="http://www.facebook.com/Cocacola" data-width="292" data-show-faces="true" data-stream="true" data-header="true"></div> </body> </html> 
+5
source

just need to replace the code:

 <div class="fb-like-box" data-href="http://www.facebook.com/jsfiddle" data-width="292" data-show-faces="true" data-stream="false" data-header="true"> 

with this:

 <fb:like-box href="http://www.facebook.com/jsfiddle" colorscheme="light" show_faces="false" header="false" stream="false" show_border="false"></fb:like-box> 

and it works fine.

+1
source

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


All Articles