cordova-plugin-ymchat 1.2.0 → 1.3.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.
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cordova-plugin-ymchat",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
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.2.0"
2
+ <plugin id="cordova-plugin-ymchat" version="1.3.0"
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>
@@ -24,7 +24,7 @@
24
24
  </config-file>
25
25
  <source-file src="src/android/com/yellow/ai/ymchat/YmChatCordova.java" target-dir="src/com/yellow/ai/ymchat" />
26
26
  <source-file src="src/android/com/yellow/ai/ymchat/YmChatService.java" target-dir="src/com/yellow/ai/ymchat" />
27
- <source-file src="src/android/com/yellow/ai/ymchat/Utils/Utils.java" target-dir="src/com/yellow/ai/ymchat/utils" />
27
+ <source-file src="src/android/com/yellow/ai/ymchat/utils/Utils.java" target-dir="src/com/yellow/ai/ymchat/utils" />
28
28
  <framework custom="true" src="src/android/build.gradle" type="gradleReference" />
29
29
  <framework src="androidx.appcompat:appcompat:1.0.0" />
30
30
  </platform>
@@ -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.6.+'
27
+ implementation 'com.github.yellowmessenger:YMChatbot-Android:v1.7.+'
28
28
  }
@@ -59,6 +59,9 @@ public class YmChatCordova extends CordovaPlugin {
59
59
  case "setVersion":
60
60
  setVersion(args,callbackContext);
61
61
  return true;
62
+ case "setCustomLoaderURL":
63
+ setCustomLoaderURL(args, callbackContext);
64
+ return true;
62
65
  }
63
66
  return false;
64
67
  }
@@ -173,4 +176,13 @@ public class YmChatCordova extends CordovaPlugin {
173
176
  }
174
177
  }
175
178
 
179
+ public void setCustomLoaderURL(JSONArray args, CallbackContext callbackContext) {
180
+ try {
181
+ String customUrl = args.getString(0);
182
+ ymChatService.setCustomLoaderUrl(customUrl, callbackContext);
183
+ } catch (Exception e) {
184
+ Utils.genericErrorHelper(e, callbackContext);
185
+ }
186
+ }
187
+
176
188
  }
@@ -128,4 +128,8 @@ public class YmChatService {
128
128
  public void setVersion(int version, CallbackContext callbackContext) {
129
129
  ymChat.config.version = version;
130
130
  }
131
+
132
+ public void setCustomLoaderUrl(String url, CallbackContext callbackContext) {
133
+ ymChat.config.customLoaderUrl = url;
134
+ }
131
135
  }
package/src/ios/ymchat.m CHANGED
@@ -130,4 +130,11 @@
130
130
  }];
131
131
  }
132
132
 
133
+ - (void)setCustomLoaderURL:(CDVInvokedUrlCommand*)command
134
+ {
135
+ NSString* url = [command.arguments objectAtIndex:0];
136
+ assert(YMChat.shared.config != nil);
137
+ YMChat.shared.config.customLoaderUrl = url;
138
+ }
139
+
133
140
  @end
package/www/ymchat.js CHANGED
@@ -40,6 +40,9 @@ const YmChatAPI = {
40
40
  },
41
41
  setVersion: (version) => {
42
42
  exec(null, null, "ymchat", "setVersion", [version])
43
+ },
44
+ setCustomLoaderURL: (url) => {
45
+ exec(null, null, "ymchat", "setCustomLoaderURL", [url]);
43
46
  }
44
47
  };
45
48