cordova-plugin-ymchat 2.2.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/ios/ymchat.m +5 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cordova-plugin-ymchat",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "Cordova plugin to integrate yellow.ai chatbot",
5
5
  "cordova": {
6
6
  "id": "cordova-plugin-ymchat",
package/src/ios/ymchat.m CHANGED
@@ -95,7 +95,11 @@
95
95
 
96
96
  - (void)onEventFromBotWithResponse:(YMBotEventResponse *)response {
97
97
  CDVPluginResult* pluginResult = nil;
98
- NSDictionary* event = @{ @"code":response.code,@"data": response.data};
98
+ NSMutableDictionary *event = [[NSMutableDictionary alloc]initWithCapacity:10];
99
+ [event setObject:response.code forKey:@"code"];
100
+ if(response.data){
101
+ [event setObject:response.data forKey:@"data"];
102
+ }
99
103
  pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:event];
100
104
  [pluginResult setKeepCallbackAsBool:YES];
101
105
  [self.commandDelegate sendPluginResult:pluginResult callbackId:onEvent.callbackId];