cordova-plugin-ymchat 1.4.0 → 2.1.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/.vscode/settings.json +3 -0
- 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 +10 -10
- package/src/android/com/yellow/ai/ymchat/YmChatService.java +4 -4
- package/src/ios/ymchat.m +6 -6
- package/www/ymchat.js +4 -4
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="1.
|
|
2
|
+
<plugin id="cordova-plugin-ymchat" version="2.1.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.8" 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:
|
|
27
|
+
implementation 'com.github.yellowmessenger:YMChatbot-Android:v2.1.+'
|
|
28
28
|
}
|
|
@@ -59,11 +59,11 @@ public class YmChatCordova extends CordovaPlugin {
|
|
|
59
59
|
case "setVersion":
|
|
60
60
|
setVersion(args,callbackContext);
|
|
61
61
|
return true;
|
|
62
|
-
case "
|
|
63
|
-
|
|
62
|
+
case "setStatusBarColor":
|
|
63
|
+
setStatusBarColor(args,callbackContext);
|
|
64
64
|
return true;
|
|
65
|
-
case "
|
|
66
|
-
|
|
65
|
+
case "setCloseButtonColor":
|
|
66
|
+
setCloseButtonColor(args,callbackContext);
|
|
67
67
|
return true;
|
|
68
68
|
case "setCustomLoaderURL":
|
|
69
69
|
setCustomLoaderURL(args, callbackContext);
|
|
@@ -72,19 +72,19 @@ public class YmChatCordova extends CordovaPlugin {
|
|
|
72
72
|
return false;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
private void
|
|
75
|
+
private void setCloseButtonColor(JSONArray args, CallbackContext callbackContext) {
|
|
76
76
|
try {
|
|
77
|
-
String
|
|
78
|
-
ymChatService.
|
|
77
|
+
String color = args.getString(0);
|
|
78
|
+
ymChatService.setCloseButtonColor(color, callbackContext);
|
|
79
79
|
} catch (Exception e) {
|
|
80
80
|
Utils.genericErrorHelper(e, callbackContext);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
private void
|
|
84
|
+
private void setStatusBarColor(JSONArray args, CallbackContext callbackContext) {
|
|
85
85
|
try {
|
|
86
|
-
String
|
|
87
|
-
ymChatService.
|
|
86
|
+
String color = args.getString(0);
|
|
87
|
+
ymChatService.setStatusBarColor(color, callbackContext);
|
|
88
88
|
} catch (Exception e) {
|
|
89
89
|
Utils.genericErrorHelper(e, callbackContext);
|
|
90
90
|
}
|
|
@@ -133,11 +133,11 @@ public class YmChatService {
|
|
|
133
133
|
ymChat.config.customLoaderUrl = url;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
public void
|
|
137
|
-
ymChat.config.
|
|
136
|
+
public void setCloseButtonColor(String color, CallbackContext callbackContext) {
|
|
137
|
+
ymChat.config.closeButtonColorFromHex = color;
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
public void
|
|
141
|
-
ymChat.config.statusBarColorFromHex =
|
|
140
|
+
public void setStatusBarColor(String color, CallbackContext callbackContext) {
|
|
141
|
+
ymChat.config.statusBarColorFromHex = color;
|
|
142
142
|
}
|
|
143
143
|
}
|
package/src/ios/ymchat.m
CHANGED
|
@@ -137,18 +137,18 @@
|
|
|
137
137
|
YMChat.shared.config.customLoaderUrl = url;
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
- (void)
|
|
140
|
+
- (void)setStatusBarColor:(CDVInvokedUrlCommand*)command
|
|
141
141
|
{
|
|
142
|
-
NSString*
|
|
142
|
+
NSString* color = [command.arguments objectAtIndex:0];
|
|
143
143
|
assert(YMChat.shared.config != nil);
|
|
144
|
-
YMChat.shared.config.statusBarColor = [self getColorFromHexString:
|
|
144
|
+
YMChat.shared.config.statusBarColor = [self getColorFromHexString:color];
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
- (void)
|
|
147
|
+
- (void)setCloseButtonColor:(CDVInvokedUrlCommand*)command
|
|
148
148
|
{
|
|
149
|
-
NSString*
|
|
149
|
+
NSString* color = [command.arguments objectAtIndex:0];
|
|
150
150
|
assert(YMChat.shared.config != nil);
|
|
151
|
-
YMChat.shared.config.closeButtonColor = [self getColorFromHexString:
|
|
151
|
+
YMChat.shared.config.closeButtonColor = [self getColorFromHexString:color];
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
- (UIColor *)getColorFromHexString:(NSString *)hexString {
|
package/www/ymchat.js
CHANGED
|
@@ -44,11 +44,11 @@ const YmChatAPI = {
|
|
|
44
44
|
setCustomLoaderURL: (url) => {
|
|
45
45
|
exec(null, null, "ymchat", "setCustomLoaderURL", [url]);
|
|
46
46
|
},
|
|
47
|
-
|
|
48
|
-
exec(null, null, "ymchat", "
|
|
47
|
+
setStatusBarColor: (color) => {
|
|
48
|
+
exec(null, null, "ymchat", "setStatusBarColor", [color]);
|
|
49
49
|
},
|
|
50
|
-
|
|
51
|
-
exec(null, null, "ymchat", "
|
|
50
|
+
setCloseButtonColor: (color) => {
|
|
51
|
+
exec(null, null, "ymchat", "setCloseButtonColor", [color]);
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
|