cordova-plugin-ymchat 2.18.2 → 2.19.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.19.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>
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
<config-file parent="/*" target="AndroidManifest.xml">
|
|
20
20
|
<uses-permission android:name="android.permission.INTERNET" />
|
|
21
21
|
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
|
22
|
-
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
|
23
22
|
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
|
24
23
|
</config-file>
|
|
25
24
|
<source-file src="src/android/com/yellow/ai/ymchat/YmChatCordova.java" target-dir="src/com/yellow/ai/ymchat" />
|
|
@@ -34,7 +33,7 @@
|
|
|
34
33
|
<source url="https://github.com/CocoaPods/Specs.git" branch="master"/>
|
|
35
34
|
</config>
|
|
36
35
|
<pods use-frameworks="true">
|
|
37
|
-
<pod name="YMChat" spec="~> 1.
|
|
36
|
+
<pod name="YMChat" spec="~> 1.22.1" swift-version="5.0"/>
|
|
38
37
|
</pods>
|
|
39
38
|
</podspec>
|
|
40
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.20.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;
|
|
@@ -339,6 +342,15 @@ public class YmChatCordova extends CordovaPlugin {
|
|
|
339
342
|
}
|
|
340
343
|
}
|
|
341
344
|
|
|
345
|
+
private void setOpenLinkExternally(JSONArray args, CallbackContext callbackContext) {
|
|
346
|
+
try {
|
|
347
|
+
boolean shouldOpenLinkExternally = args.getBoolean(0);
|
|
348
|
+
ymChatService.setOpenLinkExternally(shouldOpenLinkExternally, callbackContext);
|
|
349
|
+
} catch (Exception e) {
|
|
350
|
+
Utils.genericErrorHelper(e, callbackContext);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
342
354
|
public void setThemeBotName(JSONArray args, CallbackContext callbackContext) {
|
|
343
355
|
try {
|
|
344
356
|
String botName = 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
|
}
|
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];
|
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
|
},
|