cordova-plugin-ymchat 2.3.1 → 2.4.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.4.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.10" 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.4.+'
|
|
28
28
|
}
|
|
@@ -80,6 +80,9 @@ public class YmChatCordova extends CordovaPlugin {
|
|
|
80
80
|
case "useLiteVersion":
|
|
81
81
|
useLiteVersion(args, callbackContext);
|
|
82
82
|
return true;
|
|
83
|
+
case "reloadBot":
|
|
84
|
+
reloadBot();
|
|
85
|
+
return true;
|
|
83
86
|
}
|
|
84
87
|
return false;
|
|
85
88
|
}
|
|
@@ -147,6 +150,10 @@ public class YmChatCordova extends CordovaPlugin {
|
|
|
147
150
|
ymChatService.closeBot();
|
|
148
151
|
}
|
|
149
152
|
|
|
153
|
+
public void reloadBot() {
|
|
154
|
+
ymChatService.reloadBot();
|
|
155
|
+
}
|
|
156
|
+
|
|
150
157
|
public void setDeviceToken(JSONArray args, CallbackContext callbackContext) {
|
|
151
158
|
try {
|
|
152
159
|
String deviceToken = args.getString(0);
|
|
@@ -8,6 +8,8 @@ import com.yellow.ai.ymchat.utils.Utils;
|
|
|
8
8
|
import com.yellowmessenger.ymchat.YMChat;
|
|
9
9
|
import com.yellowmessenger.ymchat.YMConfig;
|
|
10
10
|
import com.yellowmessenger.ymchat.models.YellowCallback;
|
|
11
|
+
import com.yellowmessenger.ymchat.models.YellowDataCallback;
|
|
12
|
+
import com.yellowmessenger.ymchat.models.YellowUnreadMessageResponse;
|
|
11
13
|
|
|
12
14
|
import org.apache.cordova.CallbackContext;
|
|
13
15
|
import org.apache.cordova.PluginResult;
|
|
@@ -47,6 +49,10 @@ public class YmChatService {
|
|
|
47
49
|
ymChat.closeBot();
|
|
48
50
|
}
|
|
49
51
|
|
|
52
|
+
public void reloadBot() {
|
|
53
|
+
ymChat.reloadBot();
|
|
54
|
+
}
|
|
55
|
+
|
|
50
56
|
public void setDeviceToken(String token, CallbackContext callbackContext) {
|
|
51
57
|
ymChat.config.deviceToken = token;
|
|
52
58
|
}
|
|
@@ -147,7 +153,7 @@ public class YmChatService {
|
|
|
147
153
|
|
|
148
154
|
public void getUnreadMessagesCount(CallbackContext callbackContext) {
|
|
149
155
|
try{
|
|
150
|
-
ymChat.getUnreadMessagesCount(ymChat.config, new
|
|
156
|
+
ymChat.getUnreadMessagesCount(ymChat.config, new YellowDataCallback() {
|
|
151
157
|
@Override
|
|
152
158
|
public <T> void success(T data) {
|
|
153
159
|
YellowUnreadMessageResponse response = (YellowUnreadMessageResponse) data;
|
package/src/ios/ymchat.m
CHANGED
package/www/ymchat.js
CHANGED
|
@@ -62,6 +62,9 @@ const YmChatAPI = {
|
|
|
62
62
|
useLiteVersion: (shouldUseLiteVersion) => {
|
|
63
63
|
exec(null, null, "ymchat", "useLiteVersion", [shouldUseLiteVersion]);
|
|
64
64
|
},
|
|
65
|
+
reloadBot: () => {
|
|
66
|
+
exec(null, null, "ymchat", "reloadBot", []);
|
|
67
|
+
},
|
|
65
68
|
};
|
|
66
69
|
|
|
67
70
|
module.exports = YmChatAPI;
|