diff --git a/CHANGELOG.md b/CHANGELOG.md index c65ad5e1..91af5a70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ -## Next release +## 0.1.2 +* Added: CallEvents: + * `Reconnected` + * `Reconnecting` ## 0.1.1 diff --git a/README.md b/README.md index f74e019e..17492378 100644 --- a/README.md +++ b/README.md @@ -321,6 +321,8 @@ The events sent are the following - incoming // web, MacOS only - ringing - connected +- reconnected +- reconnecting - callEnded - unhold - hold diff --git a/android/src/main/kotlin/com/twilio/twilio_voice/TwilioVoicePlugin.kt b/android/src/main/kotlin/com/twilio/twilio_voice/TwilioVoicePlugin.kt index 63a4d40b..c2489c04 100644 --- a/android/src/main/kotlin/com/twilio/twilio_voice/TwilioVoicePlugin.kt +++ b/android/src/main/kotlin/com/twilio/twilio_voice/TwilioVoicePlugin.kt @@ -1771,7 +1771,7 @@ class TwilioVoicePlugin : FlutterPlugin, MethodCallHandler, EventChannel.StreamH } TVNativeCallEvents.EVENT_RECONNECTING -> { - logEvent("", "Reconnecting..."); + logEvent("", "Reconnecting"); } TVNativeCallEvents.EVENT_RECONNECTED -> { diff --git a/ios/Classes/SwiftTwilioVoicePlugin.swift b/ios/Classes/SwiftTwilioVoicePlugin.swift index 0e5cbc73..077353d9 100644 --- a/ios/Classes/SwiftTwilioVoicePlugin.swift +++ b/ios/Classes/SwiftTwilioVoicePlugin.swift @@ -651,12 +651,12 @@ public class SwiftTwilioVoicePlugin: NSObject, FlutterPlugin, FlutterStreamHand } public func call(call: Call, isReconnectingWithError error: Error) { - self.sendPhoneCallEvents(description: "LOG|call:isReconnectingWithError:", isError: false) + self.sendPhoneCallEvents(description: "Reconnecting", isError: false) } public func callDidReconnect(call: Call) { - self.sendPhoneCallEvents(description: "LOG|callDidReconnect:", isError: false) + self.sendPhoneCallEvents(description: "Reconnected", isError: false) } public func callDidFailToConnect(call: Call, error: Error) { diff --git a/lib/_internal/method_channel/twilio_voice_method_channel.dart b/lib/_internal/method_channel/twilio_voice_method_channel.dart index 0d3d476c..2dba7a2d 100644 --- a/lib/_internal/method_channel/twilio_voice_method_channel.dart +++ b/lib/_internal/method_channel/twilio_voice_method_channel.dart @@ -370,6 +370,8 @@ class MethodChannelTwilioVoice extends TwilioVoicePlatform { } return CallEvent.returningCall; + } else if (state.startsWith("Reconnecting")) { + return CallEvent.reconnecting; } switch (state) { case 'Ringing': @@ -397,6 +399,8 @@ class MethodChannelTwilioVoice extends TwilioVoicePlatform { return CallEvent.bluetoothOn; case 'Bluetooth Off': return CallEvent.bluetoothOff; + case 'Reconnected': + return CallEvent.reconnected; default: if (kDebugMode) { printDebug('$state is not a valid CallState.'); diff --git a/lib/_internal/twilio_voice_web.dart b/lib/_internal/twilio_voice_web.dart index 025de3e3..9214c62c 100644 --- a/lib/_internal/twilio_voice_web.dart +++ b/lib/_internal/twilio_voice_web.dart @@ -985,7 +985,7 @@ class Call extends MethodChannelTwilioCall { /// On active call reconnecting to Twilio network void _onCallReconnecting(dynamic twilioError) { - Logger.logLocalEvent("Reconnecting..."); + Logger.logLocalEvent("Reconnecting"); } /// On active call reconnecting to Twilio network diff --git a/lib/models/call_event.dart b/lib/models/call_event.dart index 5c7174f4..6048beec 100644 --- a/lib/models/call_event.dart +++ b/lib/models/call_event.dart @@ -4,6 +4,8 @@ enum CallEvent { incoming, ringing, connected, + reconnected, + reconnecting, callEnded, unhold, hold,