isAvailable
does not block the main thread anymore
This commit is contained in:
parent
15870f8a4e
commit
5493c652fd
@ -5,4 +5,5 @@
|
|||||||
- [__change__:] Renamed `isServiceAvailable` to `isAvailable`
|
- [__change__:] Renamed `isServiceAvailable` to `isAvailable`
|
||||||
- [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.
|
@ -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.
|
||||||
|
@ -38,14 +38,16 @@
|
|||||||
*/
|
*/
|
||||||
- (void) isAvailable:(CDVInvokedUrlCommand*)command
|
- (void) isAvailable:(CDVInvokedUrlCommand*)command
|
||||||
{
|
{
|
||||||
CDVPluginResult* pluginResult;
|
[self.commandDelegate runInBackground:^{
|
||||||
BOOL isAvailable = [self isPrintingAvailable];
|
CDVPluginResult* pluginResult;
|
||||||
|
BOOL isAvailable = [self isPrintingAvailable];
|
||||||
|
|
||||||
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
|
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
|
||||||
messageAsBool:isAvailable];
|
messageAsBool:isAvailable];
|
||||||
|
|
||||||
[self.commandDelegate sendPluginResult:pluginResult
|
[self.commandDelegate sendPluginResult:pluginResult
|
||||||
callbackId:command.callbackId];
|
callbackId:command.callbackId];
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user