Add Android KitKat support

This commit is contained in:
Sebastián Katzer
2013-12-11 15:49:00 +01:00
parent c039585469
commit cf76737e21
4 changed files with 100 additions and 8 deletions

View File

@@ -39,7 +39,11 @@ Printer.prototype = {
callback.apply(scope || window, args);
};
cordova.exec(callbackFn, null, 'Printer', 'isServiceAvailable', []);
if (device.platform == 'Android' && device.version >= '4.4') {
cordova.exec(callbackFn, null, 'KitKatPrinter', 'isServiceAvailable', []);
} else {
cordova.exec(callbackFn, null, 'Printer', 'isServiceAvailable', []);
};
},
/**
@@ -57,7 +61,11 @@ Printer.prototype = {
return;
}
cordova.exec(null, null, 'Printer', 'print', [page, options]);
if (device.platform == 'Android' && device.version >= '4.4') {
cordova.exec(null, null, 'KitKatPrinter', 'print', [page, options]);
} else {
cordova.exec(null, null, 'Printer', 'print', [page, options]);
};
}
};