Fix isAvailable to return empty list on iOS

This commit is contained in:
Sebastián Katzer 2016-07-24 13:49:23 +02:00
parent 5c6c646e6d
commit 217d63292f

View File

@ -42,10 +42,11 @@
{ {
[self.commandDelegate runInBackground:^{ [self.commandDelegate runInBackground:^{
CDVPluginResult* pluginResult; CDVPluginResult* pluginResult;
BOOL isAvailable = [self isPrintingAvailable]; BOOL isAvailable = [self isPrintingAvailable];
NSArray *multipart = @[[NSNumber numberWithBool:isAvailable], @[]];
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
messageAsBool:isAvailable]; messageAsMultipart:multipart];
[self.commandDelegate sendPluginResult:pluginResult [self.commandDelegate sendPluginResult:pluginResult
callbackId:command.callbackId]; callbackId:command.callbackId];
@ -139,8 +140,8 @@
printInfo.duplex = duplexMode; printInfo.duplex = duplexMode;
printInfo.jobName = [settings objectForKey:@"name"]; printInfo.jobName = [settings objectForKey:@"name"];
controller.printInfo = printInfo; controller.printInfo = printInfo;
controller.showsPageRange = ![[settings objectForKey:@"hidePageRange"] boolValue]; controller.showsPageRange = ![[settings objectForKey:@"hidePageRange"] boolValue];
controller.showsNumberOfCopies = ![[settings objectForKey:@"hideNumberOfCopies"] boolValue]; controller.showsNumberOfCopies = ![[settings objectForKey:@"hideNumberOfCopies"] boolValue];
controller.showsPaperSelectionForLoadedPapers = ![[settings objectForKey:@"hidePaperFormat"] boolValue]; controller.showsPaperSelectionForLoadedPapers = ![[settings objectForKey:@"hidePaperFormat"] boolValue];