ConnectyCube / connectycube-flutter-call-kit

A Flutter plugin for displaying call screen when the app in the background or terminated.
https://developers.connectycube.com/flutter
Apache License 2.0
57 stars 77 forks source link

[2.3.0] iOS app instantly crashes on showCallNotification #109

Closed booooohdan closed 1 year ago

booooohdan commented 1 year ago

Flutter 3.10.6 iPhone 8 (iOS 16.1)

After the app started I see this:

[GoRouter] redirecting to RouteMatchList(/) [SwiftConnectycubeFlutterCallKitPlugin][handle] method: updateConfig [CallStreamHandler][onListen] [SwiftConnectycubeFlutterCallKitPlugin][handle] method: getLastCallId [VoIPController][pushRegistry] token: 32 bytes [VoIPController][pushRegistry] deviceToken: D7A379B221D05EB72CD62B385C014C562AF9DEE47F11C09A58F6F3FD107FE1EE [VoIPController][pushRegistry] notify listener [CallStreamHandler][onListen] tokenListener: D7A379B221D05EB72CD62B385C014C562AF9DEE47F11C09A58F6F3FD107FE1EE flutter: [initEventsHandler] rawData: {args: {voipToken: D7A379B221D05EB72CD62B385C014C562AF9DEE47F11C09A58F6F3FD107FE1EE}, event: voipToken} [log] [ConnectycubeFlutterCallKit][_processEvent] eventData: {args: {voipToken: D7A379B221D05EB72CD62B385C014C562AF9DEE47F11C09A58F6F3FD107FE1EE}, event: voipToken}

Everything fine.

But when I call my device, the app crashes and this is my output:

[SwiftConnectycubeFlutterCallKitPlugin][handle] method: showCallNotification [CallKitController][reportIncomingCall] call data: o40b-t9x1-wk87, 1, 0, Arthur Morgan, [0], {} [CallKitController][reportIncomingCall] report new call: o40b-t9x1-wk87 2 connectycube_flutter_call_kit/CallKitController.swift:113: Fatal error: Unexpectedly found nil while unwrapping an Optional value

  • thread#1, queue = 'com.apple.main-thread', stop reason = Fatal error: Unexpectedly found nil while unwrapping an Optional value frame #0: 0x00000001975e2c04 libswiftCore.dylib_swift_runtime_on_report libswiftCore.dylib: -> 0x1975e2c04 <+0>: ret libswiftCore.dylib: 0x1975e2c08 <+0>: b 0x1975e2c04 ; _swift_runtime_on_report libswiftCore.dylib: 0x1975e2c0c <+0>: adrp x8, 379510 0x1975e2c10 <+4>: ldrb w0, [x8, #0x544] Target 0: (Runner) stopped.
TatankaConCube commented 1 year ago

The System iOS CallKit works with the valid UUIDs. Check if your call id o40b-t9x1-wk87 is the valid uuid string, it looks like no.

booooohdan commented 1 year ago

@TatankaConCube thanks! Changed id to UUID format, and passed needed id via userInfo