[aerogear-dev] cordova api

Erik Jan de Wit edewit at redhat.com
Wed Sep 18 11:02:01 EDT 2013


Hi,

I was thinking about the cordova api. So ideally I would like to keep it close to the javascript api that we already have, but in cordova all things that are executed have a success and a failure callback so this doesn't really fit.

cordova.exec(successCallback, errorCallback, "AeroGearPlugin", "generateOTP", [secret]);
Nice would be if we could have something like this:

var generator = new AeroGear.Totp(secret);
var totp = generator.generateOTP();
but if we need a callback the closest to something like above will be something like this:

var generator = new AeroGear.Totp(secret);
generator.generateOTP(function(result) { console.log(result) }, function() { console.log('fail') });
maybe it's my not so great javascript knowledge but what do you guys think?

Cheers, Erik Jan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-dev/attachments/20130918/3178cc6a/attachment-0001.html 


More information about the aerogear-dev mailing list