cordova-plugin-ymchat 2.10.0 → 2.13.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
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.
|
|
2
|
+
<plugin id="cordova-plugin-ymchat" version="2.13.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>
|
|
@@ -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.
|
|
37
|
+
<pod name="YMChat" spec="~> 1.18" swift-version="5.0"/>
|
|
38
38
|
</pods>
|
|
39
39
|
</podspec>
|
|
40
40
|
<config-file parent="/*" target="config.xml">
|
package/src/android/build.gradle
CHANGED
|
@@ -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.
|
|
27
|
+
implementation 'com.github.yellowmessenger:YMChatbot-Android:v2.13.+'
|
|
28
28
|
}
|
|
@@ -98,6 +98,27 @@ public class YmChatCordova extends CordovaPlugin {
|
|
|
98
98
|
case "sendEventToBot":
|
|
99
99
|
sendEventToBot(args,callbackContext);
|
|
100
100
|
return true;
|
|
101
|
+
case "setThemeBotName":
|
|
102
|
+
setThemeBotName(args,callbackContext);
|
|
103
|
+
return true;
|
|
104
|
+
case "setThemeBotDescription":
|
|
105
|
+
setThemeBotDescription(args,callbackContext);
|
|
106
|
+
return true;
|
|
107
|
+
case "setThemePrimaryColor":
|
|
108
|
+
setThemePrimaryColor(args,callbackContext);
|
|
109
|
+
return true;
|
|
110
|
+
case "setThemeSecondaryColor":
|
|
111
|
+
setThemeSecondaryColor(args,callbackContext);
|
|
112
|
+
return true;
|
|
113
|
+
case "setThemeBotBubbleBackgroundColor":
|
|
114
|
+
setThemeBotBubbleBackgroundColor(args,callbackContext);
|
|
115
|
+
return true;
|
|
116
|
+
case "setThemeBotIcon":
|
|
117
|
+
setThemeBotIcon(args,callbackContext);
|
|
118
|
+
return true;
|
|
119
|
+
case "setThemeBotClickIcon":
|
|
120
|
+
setThemeBotClickIcon(args,callbackContext);
|
|
121
|
+
return true;
|
|
101
122
|
}
|
|
102
123
|
return false;
|
|
103
124
|
}
|
|
@@ -339,6 +360,15 @@ public class YmChatCordova extends CordovaPlugin {
|
|
|
339
360
|
}
|
|
340
361
|
}
|
|
341
362
|
|
|
363
|
+
public void setThemeBotBubbleBackgroundColor(JSONArray args, CallbackContext callbackContext) {
|
|
364
|
+
try {
|
|
365
|
+
String color = args.getString(0);
|
|
366
|
+
ymChatService.setThemeBotBubbleBackgroundColor(color, callbackContext);
|
|
367
|
+
} catch (Exception e) {
|
|
368
|
+
Utils.genericErrorHelper(e, callbackContext);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
342
372
|
public void setThemeBotIcon(JSONArray args, CallbackContext callbackContext) {
|
|
343
373
|
try {
|
|
344
374
|
String iconUrl = args.getString(0);
|
|
@@ -233,6 +233,10 @@ public class YmChatService {
|
|
|
233
233
|
ymChat.config.theme.secondaryColor = color;
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
+
public void setThemeBotBubbleBackgroundColor(String color, CallbackContext callbackContext) {
|
|
237
|
+
ymChat.config.theme.botBubbleBackgroundColor = color;
|
|
238
|
+
}
|
|
239
|
+
|
|
236
240
|
public void setThemeBotIcon(String iconUrl, CallbackContext callbackContext) {
|
|
237
241
|
ymChat.config.theme.botIcon = iconUrl;
|
|
238
242
|
}
|
package/src/ios/ymchat.m
CHANGED
|
@@ -263,6 +263,13 @@
|
|
|
263
263
|
YMChat.shared.config.theme.secondaryColor = [self getColorFromHexString:color];
|
|
264
264
|
}
|
|
265
265
|
|
|
266
|
+
- (void)setThemeBotBubbleBackgroundColor:(CDVInvokedUrlCommand*)command
|
|
267
|
+
{
|
|
268
|
+
NSString* color = [command.arguments objectAtIndex:0];
|
|
269
|
+
assert(YMChat.shared.config != nil);
|
|
270
|
+
YMChat.shared.config.theme.botBubbleBackgroundColor = [self getColorFromHexString:color];
|
|
271
|
+
}
|
|
272
|
+
|
|
266
273
|
- (void)setThemeBotIcon:(CDVInvokedUrlCommand*)command
|
|
267
274
|
{
|
|
268
275
|
NSString* iconUrl = [command.arguments objectAtIndex:0];
|
package/www/ymchat.js
CHANGED
|
@@ -86,6 +86,9 @@ const YmChatAPI = {
|
|
|
86
86
|
setThemeSecondaryColor: (color) => {
|
|
87
87
|
exec(null, null, "ymchat", "setThemeSecondaryColor", [color]);
|
|
88
88
|
},
|
|
89
|
+
setThemeBotBubbleBackgroundColor: (color) => {
|
|
90
|
+
exec(null, null, "ymchat", "setThemeBotBubbleBackgroundColor", [color]);
|
|
91
|
+
},
|
|
89
92
|
setThemeBotIcon: (iconUrl) => {
|
|
90
93
|
exec(null, null, "ymchat", "setThemeBotIcon", [iconUrl]);
|
|
91
94
|
},
|