File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,13 @@ -(void)launchPrint:(NSData *) data
55
55
};
56
56
57
57
if (_pickedPrinter) {
58
- [printInteractionController printToPrinter: _pickedPrinter completionHandler: completionHandler];
58
+ [_pickedPrinter contactPrinter: ^(BOOL available) {
59
+ if (available) {
60
+ [printInteractionController printToPrinter: self ->_pickedPrinter completionHandler: completionHandler];
61
+ } else {
62
+ reject (RCTErrorUnspecified, nil , RCTErrorWithMessage (@" Selected printer is unavailable" ));
63
+ }
64
+ }];
59
65
} else if ([UIDevice currentDevice ].userInterfaceIdiom == UIUserInterfaceIdiomPad) { // iPad
60
66
UIView *view = [[UIApplication sharedApplication ] keyWindow ].rootViewController .view ;
61
67
[printInteractionController presentFromRect: view.frame inView: view animated: YES completionHandler: completionHandler];
You can’t perform that action at this time.
0 commit comments