isAvailable does not block the main thread anymore

This commit is contained in:
Sebastián Katzer 2014-09-12 10:53:44 +02:00
parent 15870f8a4e
commit 5493c652fd
3 changed files with 11 additions and 7 deletions

View File

@ -6,3 +6,4 @@
- [enhancement:] New print options like `name`, `landscape` or `duplex` - [enhancement:] New print options like `name`, `landscape` or `duplex`
- [enhancement:] Ability to print remote content via URI - [enhancement:] Ability to print remote content via URI
- [enhancement:] Callback support - [enhancement:] Callback support
- [bugfix:] `isAvailable` does not block the main thread anymore.

View File

@ -100,6 +100,7 @@ cordova plugin rm de.appplant.cordova.plugin.printer
- [enhancement:] New print options like `name`, `landscape` or `duplex` - [enhancement:] New print options like `name`, `landscape` or `duplex`
- [enhancement:] Ability to print remote content via URI - [enhancement:] Ability to print remote content via URI
- [enhancement:] Callback support - [enhancement:] Callback support
- [bugfix:] `isAvailable` does not block the main thread anymore.
#### Further informations #### Further informations
- See [CHANGELOG.md][changelog] to get the full changelog for the plugin. - See [CHANGELOG.md][changelog] to get the full changelog for the plugin.

View File

@ -38,6 +38,7 @@
*/ */
- (void) isAvailable:(CDVInvokedUrlCommand*)command - (void) isAvailable:(CDVInvokedUrlCommand*)command
{ {
[self.commandDelegate runInBackground:^{
CDVPluginResult* pluginResult; CDVPluginResult* pluginResult;
BOOL isAvailable = [self isPrintingAvailable]; BOOL isAvailable = [self isPrintingAvailable];
@ -46,6 +47,7 @@
[self.commandDelegate sendPluginResult:pluginResult [self.commandDelegate sendPluginResult:pluginResult
callbackId:command.callbackId]; callbackId:command.callbackId];
}];
} }
/** /**