print
returns boolean to inform about the result
This commit is contained in:
parent
13c9d3dbef
commit
43c325317a
@ -4,6 +4,7 @@
|
|||||||
- [__change__:] Plugin requires Android KitKat or newer
|
- [__change__:] Plugin requires Android KitKat or newer
|
||||||
- [__change__:] `isAvailable` returns false if no enabled print services can be found (Android)
|
- [__change__:] `isAvailable` returns false if no enabled print services can be found (Android)
|
||||||
- [enhancement:] `isAvailable` returns additional list of available print services (Android)
|
- [enhancement:] `isAvailable` returns additional list of available print services (Android)
|
||||||
|
- [enhancement:] `print` returns bool value to indicate the result
|
||||||
- [enhancement:] Support `duplex` attribute (Android)
|
- [enhancement:] Support `duplex` attribute (Android)
|
||||||
|
|
||||||
|
|
||||||
|
@ -229,7 +229,10 @@ public class Printer extends CordovaPlugin {
|
|||||||
public void run() {
|
public void run() {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (job.isCancelled() || job.isCompleted() || job.isFailed()) {
|
if (job.isCancelled() || job.isCompleted() || job.isFailed()) {
|
||||||
command.success();
|
PluginResult res = new PluginResult(
|
||||||
|
PluginResult.Status.OK, job.isCompleted());
|
||||||
|
|
||||||
|
command.sendPluginResult(res);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -206,7 +206,8 @@
|
|||||||
[controller presentFromRect:rect inView:self.webView animated:YES completionHandler:
|
[controller presentFromRect:rect inView:self.webView animated:YES completionHandler:
|
||||||
^(UIPrintInteractionController *ctrl, BOOL ok, NSError *e) {
|
^(UIPrintInteractionController *ctrl, BOOL ok, NSError *e) {
|
||||||
CDVPluginResult* pluginResult =
|
CDVPluginResult* pluginResult =
|
||||||
[CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
|
[CDVPluginResult resultWithStatus:CDVCommandStatus_OK
|
||||||
|
messageAsBool:ok];
|
||||||
|
|
||||||
[self.commandDelegate sendPluginResult:pluginResult
|
[self.commandDelegate sendPluginResult:pluginResult
|
||||||
callbackId:_callbackId];
|
callbackId:_callbackId];
|
||||||
@ -216,7 +217,8 @@
|
|||||||
[controller presentAnimated:YES completionHandler:
|
[controller presentAnimated:YES completionHandler:
|
||||||
^(UIPrintInteractionController *ctrl, BOOL ok, NSError *e) {
|
^(UIPrintInteractionController *ctrl, BOOL ok, NSError *e) {
|
||||||
CDVPluginResult* pluginResult =
|
CDVPluginResult* pluginResult =
|
||||||
[CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
|
[CDVPluginResult resultWithStatus:CDVCommandStatus_OK
|
||||||
|
messageAsBool:ok];
|
||||||
|
|
||||||
[self.commandDelegate sendPluginResult:pluginResult
|
[self.commandDelegate sendPluginResult:pluginResult
|
||||||
callbackId:_callbackId];
|
callbackId:_callbackId];
|
||||||
@ -241,7 +243,8 @@
|
|||||||
[controller printToPrinter:printer completionHandler:
|
[controller printToPrinter:printer completionHandler:
|
||||||
^(UIPrintInteractionController *ctrl, BOOL ok, NSError *e) {
|
^(UIPrintInteractionController *ctrl, BOOL ok, NSError *e) {
|
||||||
CDVPluginResult* pluginResult =
|
CDVPluginResult* pluginResult =
|
||||||
[CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
|
[CDVPluginResult resultWithStatus:CDVCommandStatus_OK
|
||||||
|
messageAsBool:ok];
|
||||||
|
|
||||||
[self.commandDelegate sendPluginResult:pluginResult
|
[self.commandDelegate sendPluginResult:pluginResult
|
||||||
callbackId:_callbackId];
|
callbackId:_callbackId];
|
||||||
|
Loading…
Reference in New Issue
Block a user