Skip to content

Commit 814d411

Browse files
authored
Merge pull request #287 from cybex-dev/fix_ios_devicetoken_callstate
Fixes: Adds missing deviceToken to CallEvent on iOS
2 parents c9a1021 + eec6b61 commit 814d411

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## Next Release
22

3+
* Fix: [iOS] Add missing `deviceToken` when reporting 'DEVICETOKEN' `CallEvent`. [Issue #241](https://github.com/cybex-dev/twilio_voice/issues/241)
34
* Fix: [iOS] Notifications not showing when app is in foreground.
45

56
## 0.3.1

ios/Classes/SwiftTwilioVoicePlugin.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,9 @@ public class SwiftTwilioVoicePlugin: NSObject, FlutterPlugin, FlutterStreamHand
735735
self.sendPhoneCallEvents(description: "LOG|Call failed to connect: \(error.localizedDescription)", isError: false)
736736
self.sendPhoneCallEvents(description: "Call Ended", isError: false)
737737
if(error.localizedDescription.contains("Access Token expired")){
738-
self.sendPhoneCallEvents(description: "DEVICETOKEN", isError: false)
738+
if let deviceToken = deviceToken {
739+
self.sendPhoneCallEvents(description: "DEVICETOKEN|\(String(decoding: deviceToken, as: UTF8.self))", isError: false)
740+
}
739741
}
740742
if let completion = self.callKitCompletionCallback {
741743
completion(false)

0 commit comments

Comments
 (0)