diff --git a/CHANGELOG.md b/CHANGELOG.md index fd4fed4..d70d9bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## ChangeLog -#### Version 0.7.0 (not yet released) +#### Version 0.7.1 (not yet released) - [bugfix:] `isAvailable` does not block the main thread anymore. +- [bugfix:] iPad+iOS8 incompatibility (Thanks to __zmagyar__) #### Version 0.7.0 (12.09.2014) - Android Printing Framework support diff --git a/README.md b/README.md index 1a11d4b..7cf230e 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,10 @@ cordova plugin rm de.appplant.cordova.plugin.printer ## ChangeLog +#### Version 0.7.1 (not yet released) +- [bugfix:] `isAvailable` does not block the main thread anymore. +- [bugfix:] iPad+iOS8 incompatibility (Thanks to __zmagyar__) + #### Version 0.7.0 (12.09.2014) - Android Printing Framework support - [__change__:] Renamed `isServiceAvailable` to `isAvailable` diff --git a/src/ios/APPPrinter.m b/src/ios/APPPrinter.m index 80ab2ef..6eadc31 100755 --- a/src/ios/APPPrinter.m +++ b/src/ios/APPPrinter.m @@ -20,6 +20,7 @@ */ #import "APPPrinter.h" +#import @interface APPPrinter () @@ -184,14 +185,28 @@ */ - (void) presentPrintController:(UIPrintInteractionController*)controller { - [controller presentAnimated:YES completionHandler: - ^(UIPrintInteractionController *ctrl, BOOL ok, NSError *e) { - CDVPluginResult* pluginResult = - [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; + if(CDV_IsIPad()) { + CGRect rect = CGRectMake(40, 30, 0, 0); - [self.commandDelegate sendPluginResult:pluginResult - callbackId:_callbackId]; - }]; + [controller presentFromRect:rect inView:self.webView animated:YES completionHandler: + ^(UIPrintInteractionController *ctrl, BOOL ok, NSError *e) { + CDVPluginResult* pluginResult = + [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; + + [self.commandDelegate sendPluginResult:pluginResult + callbackId:_callbackId]; + }]; + } + else { + [controller presentAnimated:YES completionHandler: + ^(UIPrintInteractionController *ctrl, BOOL ok, NSError *e) { + CDVPluginResult* pluginResult = + [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; + + [self.commandDelegate sendPluginResult:pluginResult + callbackId:_callbackId]; + }]; + } } /**