cordova-plugin-ymchat 2.1.0 → 2.2.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/Readme.md +1 -1
- package/package.json +1 -1
- package/plugin.xml +2 -2
- package/src/android/build.gradle +1 -1
- package/src/android/com/yellow/ai/ymchat/YmChatCordova.java +24 -0
- package/src/android/com/yellow/ai/ymchat/YmChatService.java +8 -0
- package/src/ios/ymchat.m +14 -0
- package/www/ymchat.js +7 -1
- package/.vscode/settings.json +0 -3
package/Readme.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
## Documentation
|
|
4
4
|
|
|
5
5
|
For integration and usage refer documentation
|
|
6
|
-
[https://docs.yellow.ai/docs/platform_concepts/
|
|
6
|
+
[https://docs.yellow.ai/docs/platform_concepts/mobile/chatbot/cordova](https://docs.yellow.ai/docs/platform_concepts/mobile/chatbot/cordova)
|
|
7
7
|
|
|
8
8
|
## Demo App
|
|
9
9
|
|
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.1.
|
|
2
|
+
<plugin id="cordova-plugin-ymchat" version="2.1.1"
|
|
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.9" 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.2.+'
|
|
28
28
|
}
|
|
@@ -68,10 +68,34 @@ public class YmChatCordova extends CordovaPlugin {
|
|
|
68
68
|
case "setCustomLoaderURL":
|
|
69
69
|
setCustomLoaderURL(args, callbackContext);
|
|
70
70
|
return true;
|
|
71
|
+
case "setDisableActionsOnLoad":
|
|
72
|
+
setDisableActionsOnLoad(args, callbackContext);
|
|
73
|
+
return true;
|
|
74
|
+
case "useLiteVersion":
|
|
75
|
+
useLiteVersion(args, callbackContext);
|
|
76
|
+
return true;
|
|
71
77
|
}
|
|
72
78
|
return false;
|
|
73
79
|
}
|
|
74
80
|
|
|
81
|
+
private void useLiteVersion(JSONArray args, CallbackContext callbackContext) {
|
|
82
|
+
try {
|
|
83
|
+
boolean shouldUseLiteVersion = args.getBoolean(0);
|
|
84
|
+
ymChatService.useLiteVersion(shouldUseLiteVersion, callbackContext);
|
|
85
|
+
} catch (Exception e) {
|
|
86
|
+
Utils.genericErrorHelper(e, callbackContext);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
private void setDisableActionsOnLoad(JSONArray args, CallbackContext callbackContext) {
|
|
91
|
+
try {
|
|
92
|
+
boolean shouldDisableActionsOnLoad = args.getBoolean(0);
|
|
93
|
+
ymChatService.setDisableActionsOnLoad(shouldDisableActionsOnLoad, callbackContext);
|
|
94
|
+
} catch (Exception e) {
|
|
95
|
+
Utils.genericErrorHelper(e, callbackContext);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
75
99
|
private void setCloseButtonColor(JSONArray args, CallbackContext callbackContext) {
|
|
76
100
|
try {
|
|
77
101
|
String color = args.getString(0);
|
|
@@ -140,4 +140,12 @@ public class YmChatService {
|
|
|
140
140
|
public void setStatusBarColor(String color, CallbackContext callbackContext) {
|
|
141
141
|
ymChat.config.statusBarColorFromHex = color;
|
|
142
142
|
}
|
|
143
|
+
|
|
144
|
+
public void setDisableActionsOnLoad(boolean shouldDisableActionsOnLoad, CallbackContext callbackContext) {
|
|
145
|
+
ymChat.config.disableActionsOnLoad = shouldDisableActionsOnLoad;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
public void useLiteVersion(boolean shouldUseLiteVersion, CallbackContext callbackContext) {
|
|
149
|
+
ymChat.config.useLiteVersion = shouldUseLiteVersion;
|
|
150
|
+
}
|
|
143
151
|
}
|
package/src/ios/ymchat.m
CHANGED
|
@@ -151,6 +151,20 @@
|
|
|
151
151
|
YMChat.shared.config.closeButtonColor = [self getColorFromHexString:color];
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
+
- (void)setDisableActionsOnLoad:(CDVInvokedUrlCommand*)command
|
|
155
|
+
{
|
|
156
|
+
BOOL shouldDisableActionsOnLoad = [command.arguments objectAtIndex:0];
|
|
157
|
+
assert(YMChat.shared.config != nil);
|
|
158
|
+
YMChat.shared.config.disableActionsOnLoad = shouldDisableActionsOnLoad;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
- (void)useLiteVersion:(CDVInvokedUrlCommand*)command
|
|
162
|
+
{
|
|
163
|
+
BOOL shouldUseLiteVersion = [command.arguments objectAtIndex:0];
|
|
164
|
+
assert(YMChat.shared.config != nil);
|
|
165
|
+
YMChat.shared.config.useLiteVersion = shouldUseLiteVersion;
|
|
166
|
+
}
|
|
167
|
+
|
|
154
168
|
- (UIColor *)getColorFromHexString:(NSString *)hexString {
|
|
155
169
|
unsigned rgbValue = 0;
|
|
156
170
|
NSScanner *scanner = [NSScanner scannerWithString:hexString];
|
package/www/ymchat.js
CHANGED
|
@@ -49,7 +49,13 @@ const YmChatAPI = {
|
|
|
49
49
|
},
|
|
50
50
|
setCloseButtonColor: (color) => {
|
|
51
51
|
exec(null, null, "ymchat", "setCloseButtonColor", [color]);
|
|
52
|
-
}
|
|
52
|
+
},
|
|
53
|
+
setDisableActionsOnLoad: (shouldDisableActionsOnLoad) => {
|
|
54
|
+
exec(null, null, "ymchat", "setDisableActionsOnLoad", [shouldDisableActionsOnLoad]);
|
|
55
|
+
},
|
|
56
|
+
useLiteVersion: (shouldUseLiteVersion) => {
|
|
57
|
+
exec(null, null, "ymchat", "useLiteVersion", [shouldUseLiteVersion]);
|
|
58
|
+
},
|
|
53
59
|
};
|
|
54
60
|
|
|
55
61
|
module.exports = YmChatAPI;
|
package/.vscode/settings.json
DELETED