cordova-plugin-ymchat 3.1.0 → 3.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/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [3.2.0]
9
+
10
+ ### Added
11
+
12
+ - **`stopVoiceMode()`** — lets the host app programmatically end an active voice call, e.g. when a modal presentation covers the chatbot and the native view-lifecycle callback that would normally stop voice mode doesn't fire. Bridges the native SDKs' `stopVoiceMode()` for the first time (iOS `YMChat` since 2.2.0, Android `YMChatbot-Android` since v3.2.0 — both already pinned since v3.0.0 of this plugin).
13
+
8
14
  ## [3.1.0]
9
15
 
10
16
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cordova-plugin-ymchat",
3
- "version": "3.1.0",
3
+ "version": "3.2.0",
4
4
  "description": "Cordova plugin to integrate yellow.ai chatbot",
5
5
  "cordova": {
6
6
  "id": "cordova-plugin-ymchat",
package/plugin.xml CHANGED
@@ -1,5 +1,5 @@
1
1
  <?xml version='1.0' encoding='utf-8'?>
2
- <plugin id="cordova-plugin-ymchat" version="3.1.0"
2
+ <plugin id="cordova-plugin-ymchat" version="3.2.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>
@@ -56,6 +56,9 @@ public class YmChatCordova extends CordovaPlugin {
56
56
  case "closeBot":
57
57
  closeBot();
58
58
  return true;
59
+ case "stopVoiceMode":
60
+ stopVoiceMode();
61
+ return true;
59
62
  case "unlinkDeviceToken":
60
63
  unlinkDeviceToken(args, callbackContext);
61
64
  return true;
@@ -204,6 +207,10 @@ public class YmChatCordova extends CordovaPlugin {
204
207
  ymChatService.closeBot();
205
208
  }
206
209
 
210
+ public void stopVoiceMode() {
211
+ ymChatService.stopVoiceMode();
212
+ }
213
+
207
214
  public void reloadBot() {
208
215
  ymChatService.reloadBot();
209
216
  }
@@ -51,6 +51,10 @@ public class YmChatService {
51
51
  ymChat.closeBot();
52
52
  }
53
53
 
54
+ public void stopVoiceMode() {
55
+ ymChat.stopVoiceMode();
56
+ }
57
+
54
58
  public void reloadBot() {
55
59
  ymChat.reloadBot();
56
60
  }
package/src/ios/ymchat.m CHANGED
@@ -98,6 +98,11 @@
98
98
  [[YMChat shared] closeBot];
99
99
  }
100
100
 
101
+ - (void)stopVoiceMode:(CDVInvokedUrlCommand*)command
102
+ {
103
+ [[YMChat shared] stopVoiceMode];
104
+ }
105
+
101
106
  - (void)reloadBot:(CDVInvokedUrlCommand*)command
102
107
  {
103
108
  [[YMChat shared] reloadBotAndReturnError:nil];
package/www/ymchat.js CHANGED
@@ -38,6 +38,9 @@ const YmChatAPI = {
38
38
  closeBot: () => {
39
39
  exec(null, null, "ymchat", "closeBot", []);
40
40
  },
41
+ stopVoiceMode: () => {
42
+ exec(null, null, "ymchat", "stopVoiceMode", []);
43
+ },
41
44
  unlinkDeviceToken: (apiKey, success, failure) => {
42
45
  exec(success, failure, "ymchat", "unlinkDeviceToken", [apiKey])
43
46
  },