cordova-plugin-ymchat 2.15.0 → 2.17.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.17.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.21.1" 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.17.0'
|
|
28
28
|
}
|
|
@@ -89,6 +89,9 @@ public class YmChatCordova extends CordovaPlugin {
|
|
|
89
89
|
case "setMicBackgroundColor":
|
|
90
90
|
setMicBackgroundColor(args, callbackContext);
|
|
91
91
|
return true;
|
|
92
|
+
case "setMicButtonMovable":
|
|
93
|
+
setMicButtonMovable(args, callbackContext);
|
|
94
|
+
return true;
|
|
92
95
|
case "useSecureYmAuth":
|
|
93
96
|
useSecureYmAuth(args,callbackContext);
|
|
94
97
|
return true;
|
|
@@ -318,6 +321,15 @@ public class YmChatCordova extends CordovaPlugin {
|
|
|
318
321
|
}
|
|
319
322
|
}
|
|
320
323
|
|
|
324
|
+
private void setMicButtonMovable(JSONArray args, CallbackContext callbackContext) {
|
|
325
|
+
try {
|
|
326
|
+
boolean shouldMicButtonMovable = args.getBoolean(0);
|
|
327
|
+
ymChatService.setMicButtonMovable(shouldMicButtonMovable, callbackContext);
|
|
328
|
+
} catch (Exception e) {
|
|
329
|
+
Utils.genericErrorHelper(e, callbackContext);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
321
333
|
private void useSecureYmAuth(JSONArray args, CallbackContext callbackContext) {
|
|
322
334
|
try {
|
|
323
335
|
boolean shouldUseSecureYmAuth = args.getBoolean(0);
|
|
@@ -59,7 +59,7 @@ public class YmChatService {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
public void setEnableSpeech(boolean speech, CallbackContext callbackContext) {
|
|
62
|
-
ymChat.config.enableSpeech = speech;
|
|
62
|
+
ymChat.config.speechConfig.enableSpeech = speech;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
public void setAuthenticationToken(String token, CallbackContext callbackContext) {
|
|
@@ -206,11 +206,15 @@ public class YmChatService {
|
|
|
206
206
|
}
|
|
207
207
|
|
|
208
208
|
public void setMicIconColor(String color, CallbackContext callbackContext) {
|
|
209
|
-
ymChat.config.
|
|
209
|
+
ymChat.config.speechConfig.fabIconColor = color;
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
public void setMicBackgroundColor(String color, CallbackContext callbackContext) {
|
|
213
|
-
ymChat.config.
|
|
213
|
+
ymChat.config.speechConfig.fabBackgroundColor = color;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
public void setMicButtonMovable(boolean shouldMicButtonMovable, CallbackContext callbackContext) {
|
|
217
|
+
ymChat.config.speechConfig.isButtonMovable = shouldMicButtonMovable;
|
|
214
218
|
}
|
|
215
219
|
|
|
216
220
|
public void useSecureYmAuth(boolean shouldUseSecureYmAuth, CallbackContext callbackContext) {
|
package/src/ios/ymchat.m
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
{
|
|
33
33
|
BOOL enableSpeech = [command.arguments objectAtIndex:0];
|
|
34
34
|
assert(YMChat.shared.config != nil);
|
|
35
|
-
YMChat.shared.config.enableSpeech = enableSpeech;
|
|
35
|
+
YMChat.shared.config.speechConfig.enableSpeech = enableSpeech;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
- (void)setAuthenticationToken:(CDVInvokedUrlCommand*)command
|
|
@@ -218,14 +218,22 @@
|
|
|
218
218
|
{
|
|
219
219
|
NSString* color = [command.arguments objectAtIndex:0];
|
|
220
220
|
assert(YMChat.shared.config != nil);
|
|
221
|
-
YMChat.shared.config.
|
|
221
|
+
YMChat.shared.config.speechConfig.fabIconColor = [self getColorFromHexString:color];
|
|
222
222
|
}
|
|
223
223
|
|
|
224
224
|
- (void)setMicBackgroundColor:(CDVInvokedUrlCommand*)command
|
|
225
225
|
{
|
|
226
226
|
NSString* color = [command.arguments objectAtIndex:0];
|
|
227
227
|
assert(YMChat.shared.config != nil);
|
|
228
|
-
YMChat.shared.config.
|
|
228
|
+
YMChat.shared.config.speechConfig.fabBackgroundColor = [self getColorFromHexString:color];
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
- (void)setMicButtonMovable:(CDVInvokedUrlCommand*)command
|
|
232
|
+
{
|
|
233
|
+
NSNumber *shouldMicButtonMovableNumber = [command.arguments objectAtIndex:0];
|
|
234
|
+
BOOL shouldMicButtonMovable = [shouldMicButtonMovableNumber boolValue];
|
|
235
|
+
assert(YMChat.shared.config != nil);
|
|
236
|
+
YMChat.shared.config.speechConfig.isButtonMovable = shouldMicButtonMovable;
|
|
229
237
|
}
|
|
230
238
|
|
|
231
239
|
- (void)useSecureYmAuth:(CDVInvokedUrlCommand*)command
|
package/www/ymchat.js
CHANGED
|
@@ -71,6 +71,9 @@ const YmChatAPI = {
|
|
|
71
71
|
setMicBackgroundColor: (color) => {
|
|
72
72
|
exec(null, null, "ymchat", "setMicBackgroundColor", [color]);
|
|
73
73
|
},
|
|
74
|
+
setMicButtonMovable: (shouldMicButtonMovable) => {
|
|
75
|
+
exec(null, null, "ymchat", "setMicButtonMovable", [shouldMicButtonMovable]);
|
|
76
|
+
},
|
|
74
77
|
useSecureYmAuth: (shouldUseSecureYmAuth) => {
|
|
75
78
|
exec(null, null, "ymchat", "useSecureYmAuth", [shouldUseSecureYmAuth]);
|
|
76
79
|
},
|