cordova-plugin-ymchat 2.1.1 → 2.2.0

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.
package/Readme.md CHANGED
@@ -3,7 +3,7 @@
3
3
  ## Documentation
4
4
 
5
5
  For integration and usage refer documentation
6
- [https://docs.yellow.ai/docs/platform_concepts/channelConfiguration/cordova](https://docs.yellow.ai/docs/platform_concepts/channelConfiguration/cordova)
6
+ [https://docs.yellow.ai/docs/platform_concepts/mobile/chatbot/cordova](https://docs.yellow.ai/docs/platform_concepts/mobile/chatbot/cordova)
7
7
 
8
8
  ## Demo App
9
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cordova-plugin-ymchat",
3
- "version": "2.1.1",
3
+ "version": "2.2.0",
4
4
  "description": "Cordova plugin to integrate yellow.ai chatbot",
5
5
  "cordova": {
6
6
  "id": "cordova-plugin-ymchat",
package/plugin.xml CHANGED
@@ -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.8" swift-version="5.0"/>
37
+ <pod name="YMChat" spec="~> 1.9" 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:v2.1.+'
27
+ implementation 'com.github.yellowmessenger:YMChatbot-Android:v2.2.+'
28
28
  }
@@ -71,10 +71,22 @@ public class YmChatCordova extends CordovaPlugin {
71
71
  case "setDisableActionsOnLoad":
72
72
  setDisableActionsOnLoad(args, callbackContext);
73
73
  return true;
74
+ case "useLiteVersion":
75
+ useLiteVersion(args, callbackContext);
76
+ return true;
74
77
  }
75
78
  return false;
76
79
  }
77
80
 
81
+ private void useLiteVersion(JSONArray args, CallbackContext callbackContext) {
82
+ try {
83
+ boolean shouldUseLiteVersion = args.getBoolean(0);
84
+ ymChatService.useLiteVersion(shouldUseLiteVersion, callbackContext);
85
+ } catch (Exception e) {
86
+ Utils.genericErrorHelper(e, callbackContext);
87
+ }
88
+ }
89
+
78
90
  private void setDisableActionsOnLoad(JSONArray args, CallbackContext callbackContext) {
79
91
  try {
80
92
  boolean shouldDisableActionsOnLoad = args.getBoolean(0);
@@ -144,4 +144,8 @@ public class YmChatService {
144
144
  public void setDisableActionsOnLoad(boolean shouldDisableActionsOnLoad, CallbackContext callbackContext) {
145
145
  ymChat.config.disableActionsOnLoad = shouldDisableActionsOnLoad;
146
146
  }
147
+
148
+ public void useLiteVersion(boolean shouldUseLiteVersion, CallbackContext callbackContext) {
149
+ ymChat.config.useLiteVersion = shouldUseLiteVersion;
150
+ }
147
151
  }
package/src/ios/ymchat.m CHANGED
@@ -158,6 +158,13 @@
158
158
  YMChat.shared.config.disableActionsOnLoad = shouldDisableActionsOnLoad;
159
159
  }
160
160
 
161
+ - (void)useLiteVersion:(CDVInvokedUrlCommand*)command
162
+ {
163
+ BOOL shouldUseLiteVersion = [command.arguments objectAtIndex:0];
164
+ assert(YMChat.shared.config != nil);
165
+ YMChat.shared.config.useLiteVersion = shouldUseLiteVersion;
166
+ }
167
+
161
168
  - (UIColor *)getColorFromHexString:(NSString *)hexString {
162
169
  unsigned rgbValue = 0;
163
170
  NSScanner *scanner = [NSScanner scannerWithString:hexString];
package/www/ymchat.js CHANGED
@@ -53,6 +53,9 @@ const YmChatAPI = {
53
53
  setDisableActionsOnLoad: (shouldDisableActionsOnLoad) => {
54
54
  exec(null, null, "ymchat", "setDisableActionsOnLoad", [shouldDisableActionsOnLoad]);
55
55
  },
56
+ useLiteVersion: (shouldUseLiteVersion) => {
57
+ exec(null, null, "ymchat", "useLiteVersion", [shouldUseLiteVersion]);
58
+ },
56
59
  };
57
60
 
58
61
  module.exports = YmChatAPI;
@@ -1,3 +0,0 @@
1
- {
2
- "java.configuration.updateBuildConfiguration": "automatic"
3
- }