cordova-plugin-ymchat 1.5.0 → 2.1.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.
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cordova-plugin-ymchat",
3
- "version": "1.5.0",
3
+ "version": "2.1.1",
4
4
  "description": "Cordova plugin to integrate yellow.ai chatbot",
5
5
  "cordova": {
6
6
  "id": "cordova-plugin-ymchat",
package/plugin.xml CHANGED
@@ -1,5 +1,5 @@
1
1
  <?xml version='1.0' encoding='utf-8'?>
2
- <plugin id="cordova-plugin-ymchat" version="1.5.0"
2
+ <plugin id="cordova-plugin-ymchat" version="2.1.1"
3
3
  xmlns="http://apache.org/cordova/ns/plugins/1.0"
4
4
  xmlns:android="http://schemas.android.com/apk/res/android">
5
5
  <name>ymchat</name>
@@ -34,7 +34,7 @@
34
34
  <source url="https://github.com/CocoaPods/Specs.git" branch="master"/>
35
35
  </config>
36
36
  <pods use-frameworks="true">
37
- <pod name="YMChat" spec="~> 1.7" swift-version="5.0"/>
37
+ <pod name="YMChat" spec="~> 1.8" swift-version="5.0"/>
38
38
  </pods>
39
39
  </podspec>
40
40
  <config-file parent="/*" target="config.xml">
@@ -24,5 +24,5 @@ repositories {
24
24
  dependencies {
25
25
  implementation 'androidx.appcompat:appcompat:1.0.2'
26
26
  implementation 'androidx.annotation:annotation:1.0.2'
27
- implementation 'com.github.yellowmessenger:YMChatbot-Android:v1.9.+'
27
+ implementation 'com.github.yellowmessenger:YMChatbot-Android:v2.1.+'
28
28
  }
@@ -68,10 +68,22 @@ public class YmChatCordova extends CordovaPlugin {
68
68
  case "setCustomLoaderURL":
69
69
  setCustomLoaderURL(args, callbackContext);
70
70
  return true;
71
+ case "setDisableActionsOnLoad":
72
+ setDisableActionsOnLoad(args, callbackContext);
73
+ return true;
71
74
  }
72
75
  return false;
73
76
  }
74
77
 
78
+ private void setDisableActionsOnLoad(JSONArray args, CallbackContext callbackContext) {
79
+ try {
80
+ boolean shouldDisableActionsOnLoad = args.getBoolean(0);
81
+ ymChatService.setDisableActionsOnLoad(shouldDisableActionsOnLoad, callbackContext);
82
+ } catch (Exception e) {
83
+ Utils.genericErrorHelper(e, callbackContext);
84
+ }
85
+ }
86
+
75
87
  private void setCloseButtonColor(JSONArray args, CallbackContext callbackContext) {
76
88
  try {
77
89
  String color = args.getString(0);
@@ -140,4 +140,8 @@ public class YmChatService {
140
140
  public void setStatusBarColor(String color, CallbackContext callbackContext) {
141
141
  ymChat.config.statusBarColorFromHex = color;
142
142
  }
143
+
144
+ public void setDisableActionsOnLoad(boolean shouldDisableActionsOnLoad, CallbackContext callbackContext) {
145
+ ymChat.config.disableActionsOnLoad = shouldDisableActionsOnLoad;
146
+ }
143
147
  }
package/src/ios/ymchat.m CHANGED
@@ -151,6 +151,13 @@
151
151
  YMChat.shared.config.closeButtonColor = [self getColorFromHexString:color];
152
152
  }
153
153
 
154
+ - (void)setDisableActionsOnLoad:(CDVInvokedUrlCommand*)command
155
+ {
156
+ BOOL shouldDisableActionsOnLoad = [command.arguments objectAtIndex:0];
157
+ assert(YMChat.shared.config != nil);
158
+ YMChat.shared.config.disableActionsOnLoad = shouldDisableActionsOnLoad;
159
+ }
160
+
154
161
  - (UIColor *)getColorFromHexString:(NSString *)hexString {
155
162
  unsigned rgbValue = 0;
156
163
  NSScanner *scanner = [NSScanner scannerWithString:hexString];
package/www/ymchat.js CHANGED
@@ -49,7 +49,10 @@ const YmChatAPI = {
49
49
  },
50
50
  setCloseButtonColor: (color) => {
51
51
  exec(null, null, "ymchat", "setCloseButtonColor", [color]);
52
- }
52
+ },
53
+ setDisableActionsOnLoad: (shouldDisableActionsOnLoad) => {
54
+ exec(null, null, "ymchat", "setDisableActionsOnLoad", [shouldDisableActionsOnLoad]);
55
+ },
53
56
  };
54
57
 
55
58
  module.exports = YmChatAPI;