I started testing the Facebook plugin on a Crossrider extension but soon found some drawbacks.
I'm trying to listen for the write_comment
event and it works fine the first time.
Here's the code that I'm using on the extension.js
file:
appAPI.ready(function($) {
// Load the Facebook plugin
var facebookHook = appAPI.hooks.register('facebook');
facebookHook.addListener('write_comment', function(components) {
alert('on write comment');
});
});
The problem is that some times the event is fired and sometimes it's not. I can name a few scenarios:
- the event is fired just the first time
- sometimes more than once, I mean when clicking different comment input boxes but then doesn't work again
Should I use the plugin on this scope or on the background scope?
Is there another way to use Facebook API alongside with Crossrider Framework?