cordova-plugin-ymchat 2.18.3 → 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
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.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.
|
|
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">
|
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.21.0'
|
|
28
28
|
}
|
|
@@ -101,6 +101,9 @@ public class YmChatCordova extends CordovaPlugin {
|
|
|
101
101
|
case "sendEventToBot":
|
|
102
102
|
sendEventToBot(args,callbackContext);
|
|
103
103
|
return true;
|
|
104
|
+
case "setOpenLinkExternally":
|
|
105
|
+
setOpenLinkExternally(args,callbackContext);
|
|
106
|
+
return true;
|
|
104
107
|
case "setThemeBotName":
|
|
105
108
|
setThemeBotName(args,callbackContext);
|
|
106
109
|
return true;
|
|
@@ -125,6 +128,9 @@ public class YmChatCordova extends CordovaPlugin {
|
|
|
125
128
|
case "setChatContainerTheme":
|
|
126
129
|
setChatContainerTheme(args,callbackContext);
|
|
127
130
|
return true;
|
|
131
|
+
case "setThemeLinkColor":
|
|
132
|
+
setThemeLinkColor(args,callbackContext);
|
|
133
|
+
return true;
|
|
128
134
|
}
|
|
129
135
|
return false;
|
|
130
136
|
}
|
|
@@ -339,6 +345,15 @@ public class YmChatCordova extends CordovaPlugin {
|
|
|
339
345
|
}
|
|
340
346
|
}
|
|
341
347
|
|
|
348
|
+
private void setOpenLinkExternally(JSONArray args, CallbackContext callbackContext) {
|
|
349
|
+
try {
|
|
350
|
+
boolean shouldOpenLinkExternally = args.getBoolean(0);
|
|
351
|
+
ymChatService.setOpenLinkExternally(shouldOpenLinkExternally, callbackContext);
|
|
352
|
+
} catch (Exception e) {
|
|
353
|
+
Utils.genericErrorHelper(e, callbackContext);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
342
357
|
public void setThemeBotName(JSONArray args, CallbackContext callbackContext) {
|
|
343
358
|
try {
|
|
344
359
|
String botName = args.getString(0);
|
|
@@ -411,6 +426,15 @@ public class YmChatCordova extends CordovaPlugin {
|
|
|
411
426
|
}
|
|
412
427
|
}
|
|
413
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
|
+
|
|
414
438
|
private void revalidateToken(JSONArray args, CallbackContext callbackContext) {
|
|
415
439
|
try {
|
|
416
440
|
String token = args.getString(0);
|
|
@@ -221,6 +221,10 @@ public class YmChatService {
|
|
|
221
221
|
ymChat.config.useSecureYmAuth = shouldUseSecureYmAuth;
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
+
public void setOpenLinkExternally(boolean shouldOpenLinkExternally, CallbackContext callbackContext) {
|
|
225
|
+
ymChat.config.shouldOpenLinkExternally = shouldOpenLinkExternally;
|
|
226
|
+
}
|
|
227
|
+
|
|
224
228
|
public void setThemeBotName(String name, CallbackContext callbackContext) {
|
|
225
229
|
ymChat.config.theme.botName = name;
|
|
226
230
|
}
|
|
@@ -253,6 +257,10 @@ public class YmChatService {
|
|
|
253
257
|
ymChat.config.theme.chatBotTheme = theme;
|
|
254
258
|
}
|
|
255
259
|
|
|
260
|
+
public void setThemeLinkColor(String color, CallbackContext callbackContext) {
|
|
261
|
+
ymChat.config.theme.linkColor = color;
|
|
262
|
+
}
|
|
263
|
+
|
|
256
264
|
public void revalidateToken(String token, boolean refreshSession, CallbackContext callbackContext) {
|
|
257
265
|
try {
|
|
258
266
|
ymChat.revalidateToken(token, refreshSession);
|
package/src/ios/ymchat.m
CHANGED
|
@@ -243,6 +243,13 @@
|
|
|
243
243
|
YMChat.shared.config.useSecureYmAuth = shouldUseSecureYmAuth;
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
+
- (void)setOpenLinkExternally:(CDVInvokedUrlCommand*)command
|
|
247
|
+
{
|
|
248
|
+
BOOL shouldOpenLinkExternally = [command.arguments objectAtIndex:0];
|
|
249
|
+
assert(YMChat.shared.config != nil);
|
|
250
|
+
YMChat.shared.config.shouldOpenLinkExternally = shouldOpenLinkExternally;
|
|
251
|
+
}
|
|
252
|
+
|
|
246
253
|
- (void)setThemeBotName:(CDVInvokedUrlCommand*)command
|
|
247
254
|
{
|
|
248
255
|
NSString* name = [command.arguments objectAtIndex:0];
|
|
@@ -299,6 +306,13 @@
|
|
|
299
306
|
YMChat.shared.config.theme.chatBotTheme = theme;
|
|
300
307
|
}
|
|
301
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
|
+
|
|
302
316
|
- (void)revalidateToken:(CDVInvokedUrlCommand*)command
|
|
303
317
|
{
|
|
304
318
|
NSString* token = [command.arguments objectAtIndex:0];
|
package/www/ymchat.js
CHANGED
|
@@ -74,6 +74,9 @@ const YmChatAPI = {
|
|
|
74
74
|
setMicButtonMovable: (shouldMicButtonMovable) => {
|
|
75
75
|
exec(null, null, "ymchat", "setMicButtonMovable", [shouldMicButtonMovable]);
|
|
76
76
|
},
|
|
77
|
+
setOpenLinkExternally: (shouldOpenLinkExternally) => {
|
|
78
|
+
exec(null, null, "ymchat", "setOpenLinkExternally", [shouldOpenLinkExternally]);
|
|
79
|
+
},
|
|
77
80
|
useSecureYmAuth: (shouldUseSecureYmAuth) => {
|
|
78
81
|
exec(null, null, "ymchat", "useSecureYmAuth", [shouldUseSecureYmAuth]);
|
|
79
82
|
},
|
|
@@ -101,6 +104,9 @@ const YmChatAPI = {
|
|
|
101
104
|
setChatContainerTheme: (theme) => {
|
|
102
105
|
exec(null, null, "ymchat", "setChatContainerTheme", [theme]);
|
|
103
106
|
},
|
|
107
|
+
setThemeLinkColor: (color) => {
|
|
108
|
+
exec(null, null, "ymchat", "setThemeLinkColor", [color]);
|
|
109
|
+
},
|
|
104
110
|
revalidateToken: (token, refreshSession) => {
|
|
105
111
|
exec(null, null, "ymchat", "revalidateToken", [token, refreshSession]);
|
|
106
112
|
},
|