Facebook + Cordova + AngularJS encapsulation is no more?

Just a quick update following my previous post about using this Cordova Facebook plugin neatly with Cordova & AngularJS: unfortunately it seems EasyFB no longer supports the plugin because the plugin’s creators have decided to change the API and drop the previous transparent compatibility with Facebook’s JS SDK.

This is very frustrating as I’m also having issues with the older versions of the plugin that seem to be fixed in the latest release 0.7.0. So to get things working in the short term, I’ve had to abandon EasyFB and its neat AngularJS encapsulation, bringing another JS global and manual $scope.$apply()‘s into the mix.

The most annoying thing is that this breaking API change doesn’t seem to be mentioned anywhere prominent on the plugin’s readme or anywhere else I might have thought to look, so it never occurred to me that EasyFB might have stopped working with it. This should be at the top of the plugin’s docs in huge writing!

This alternative Cordova plugin also appears to have no intention of maintaining parity with Facebook’s JS SDK, and indeed lists not doing so as one of its founding principles. (At least in this case it’s clear what’s going on and they haven’t quietly changed the whole thing!) So it looks like there is no current solution which allows use of an up-to-date Cordova Facebook plugin, with proper AngularJS encapsulation, using native Facebook dialogues where available.

On a slightly more positive note, Ionic’s recent announcement of ngCordova looks very promising. Ionic’s current trajectory on several other fronts also seems good, and I’ve recently abandoned the ‘original’ Topcoat and Adobe-flavoured Phonegap tools in favour of Ionic’s versions.

There are no Facebook wrappers using ngCordova yet but hopefully it’s a matter of time before somebody either puts one together or separately devises an Angular module wrapping one of the Cordova FB plugins. If my Angular skills are up to attempting it before someone else gets there, it’s definitely on my todo list!

Comments on “Facebook + Cordova + AngularJS encapsulation is no more?

    1. I haven’t tried it out yet, and the ngCordova project is still in ‘alpha’, but somebody has made a start on a Facebook wrapper with it now which seems promising.

      As far as I can tell this is designed to work with the ‘new’ Wizcorp plugin API (i.e. version 0.7.0 onwards).

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.