Open jacop85 opened 8 years ago
i have fixed the problem by adding this Objective C code at the end of Screenshot.m file:
- (void)myPluginMethod:(CDVInvokedUrlCommand*)command { // Check command.arguments here. [self.commandDelegate runInBackground:^{ NSString* payload = nil; // Some blocking logic... CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:payload]; // The sendPluginResult method is thread-safe. [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; }]; }
source: https://cordova.apache.org/docs/en/3.0.0/guide/platforms/ios/plugin.html#iOS%20Plugins_threading
can this be made as PR?
ASAP :)
call screenshot.save function fire this error "Plugin should use a background thread" . help please .