...
|
...
|
@@ -61,15 +61,26 @@ |
|
|
if ([weakIf respondsToSelector:@selector(nativeActionDidTriggerEventWithUserInfo:completion:)]) {
|
|
|
|
|
|
[weakIf nativeActionDidTriggerEventWithUserInfo:info
|
|
|
completion:^(NSDictionary *callbackInfo, BOOL result) {
|
|
|
completion:^(id callbackInfo, BOOL result) {
|
|
|
CDVPluginResult *pluginResult;
|
|
|
CDVCommandStatus cmdStatus = CDVCommandStatus_ERROR;
|
|
|
if (result) {
|
|
|
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:callbackInfo];
|
|
|
|
|
|
cmdStatus = CDVCommandStatus_OK;
|
|
|
} else {
|
|
|
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:callbackInfo];
|
|
|
|
|
|
cmdStatus = CDVCommandStatus_ERROR;
|
|
|
}
|
|
|
if ([callbackInfo isKindOfClass:[NSString class]]) {
|
|
|
pluginResult = [CDVPluginResult resultWithStatus:cmdStatus messageAsString:(NSString *)callbackInfo];
|
|
|
|
|
|
}else if ([callbackInfo isKindOfClass:[NSDictionary class]]){
|
|
|
pluginResult = [CDVPluginResult resultWithStatus:cmdStatus
|
|
|
messageAsDictionary:(NSDictionary *)callbackInfo];
|
|
|
|
|
|
}else if ([callbackInfo isKindOfClass:[NSArray class]]){
|
|
|
pluginResult = [CDVPluginResult resultWithStatus:cmdStatus
|
|
|
messageAsMultipart:(NSArray *)callbackInfo];
|
|
|
}
|
|
|
|
|
|
[weakSelf.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
|
|
|
}];
|
|
|
} else {
|
...
|
...
|
|