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
Show replies by date