cordova-plugin-ymchat 2.19.0 → 2.20.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cordova-plugin-ymchat",
3
- "version": "2.19.0",
3
+ "version": "2.20.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="2.19.0"
2
+ <plugin id="cordova-plugin-ymchat" version="2.20.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>
@@ -33,7 +33,7 @@
33
33
  <source url="https://github.com/CocoaPods/Specs.git" branch="master"/>
34
34
  </config>
35
35
  <pods use-frameworks="true">
36
- <pod name="YMChat" spec="~> 1.22.1" swift-version="5.0"/>
36
+ <pod name="YMChat" spec="~> 1.23.0" swift-version="5.0"/>
37
37
  </pods>
38
38
  </podspec>
39
39
  <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.20.0'
27
+ implementation 'com.github.yellowmessenger:YMChatbot-Android:v2.21.0'
28
28
  }
@@ -128,6 +128,9 @@ public class YmChatCordova extends CordovaPlugin {
128
128
  case "setChatContainerTheme":
129
129
  setChatContainerTheme(args,callbackContext);
130
130
  return true;
131
+ case "setThemeLinkColor":
132
+ setThemeLinkColor(args,callbackContext);
133
+ return true;
131
134
  }
132
135
  return false;
133
136
  }
@@ -423,6 +426,15 @@ public class YmChatCordova extends CordovaPlugin {
423
426
  }
424
427
  }
425
428
 
429
+ public void setThemeLinkColor(JSONArray args, CallbackContext callbackContext) {
430
+ try {
431
+ String color = args.getString(0);
432
+ ymChatService.setThemeLinkColor(color, callbackContext);
433
+ } catch (Exception e) {
434
+ Utils.genericErrorHelper(e, callbackContext);
435
+ }
436
+ }
437
+
426
438
  private void revalidateToken(JSONArray args, CallbackContext callbackContext) {
427
439
  try {
428
440
  String token = args.getString(0);
@@ -257,6 +257,10 @@ public class YmChatService {
257
257
  ymChat.config.theme.chatBotTheme = theme;
258
258
  }
259
259
 
260
+ public void setThemeLinkColor(String color, CallbackContext callbackContext) {
261
+ ymChat.config.theme.linkColor = color;
262
+ }
263
+
260
264
  public void revalidateToken(String token, boolean refreshSession, CallbackContext callbackContext) {
261
265
  try {
262
266
  ymChat.revalidateToken(token, refreshSession);
package/src/ios/ymchat.m CHANGED
@@ -306,6 +306,13 @@
306
306
  YMChat.shared.config.theme.chatBotTheme = theme;
307
307
  }
308
308
 
309
+ - (void)setThemeLinkColor:(CDVInvokedUrlCommand*)command
310
+ {
311
+ NSString* color = [command.arguments objectAtIndex:0];
312
+ assert(YMChat.shared.config != nil);
313
+ YMChat.shared.config.theme.linkColor = [self getColorFromHexString:color];
314
+ }
315
+
309
316
  - (void)revalidateToken:(CDVInvokedUrlCommand*)command
310
317
  {
311
318
  NSString* token = [command.arguments objectAtIndex:0];
package/www/ymchat.js CHANGED
@@ -104,6 +104,9 @@ const YmChatAPI = {
104
104
  setChatContainerTheme: (theme) => {
105
105
  exec(null, null, "ymchat", "setChatContainerTheme", [theme]);
106
106
  },
107
+ setThemeLinkColor: (color) => {
108
+ exec(null, null, "ymchat", "setThemeLinkColor", [color]);
109
+ },
107
110
  revalidateToken: (token, refreshSession) => {
108
111
  exec(null, null, "ymchat", "revalidateToken", [token, refreshSession]);
109
112
  },