flutter_callkit_incoming
flutter_callkit_incoming copied to clipboard
App crashes on ios when showing call via fcm
lutter_callkit_incoming/SwiftFlutterCallkitIncomingPlugin.swift:155: Fatal error: Unexpectedly found nil while unwrapping an Optional value 2022-07-30 00:53:28.569685+0100 Runner[99582:6634921] flutter_callkit_incoming/SwiftFlutterCallkitIncomingPlugin.swift:155: Fatal error: Unexpectedly found nil while unwrapping an Optional value
lutter_callkit_incoming/SwiftFlutterCallkitIncomingPlugin.swift:155: Fatal error: Unexpectedly found nil while unwrapping an Optional value 2022-07-30 00:53:28.569685+0100 Runner[99582:6634921] flutter_callkit_incoming/SwiftFlutterCallkitIncomingPlugin.swift:155: Fatal error: Unexpectedly found nil while unwrapping an Optional value
Were you trying on simulator or real device?
As it is mentioned in the plugin doc - iOS: ONLY WORKING ON REAL DEVICE, not on simulator(Callkit framework not working on simulator)
Didn't work even on real device for me either:(
yeah i was trying in on a real device but it works very well when using pushkit
pushkit
Did you end up using native solution? Or is it some other plugin you're talking about? @abdulkash ?
Yeah
You need to use VoIP push notifications. Push notifications are not allowed to perform call actions. The system will kill your app if you try to show the callkit. When you receive a voip push, you need to imediately show the callkit, then the system will keep the app activity running and allow the pushkit wake up the app. If you dont call the callkit, the system will kill your app too. This is the reason why you cant show callkit on fcm push.
There is 2 main types of push notifications: VoIP push and regular push. Got it ?
@abdulkash show me the code you are trying to show the callkit. I think that you are trying to pass objective C params on a swift code.
I had the same issue, but i was using VOIP Push. The reason that the app was crashing was that, when I sent the voip push notification from my server the id parameter was an empty string. This also caused the error: Fatal error: Unexpectedly found nil while unwrapping an Optional value. @hiennguyen92: is it possible to validate if the id parameter is empty, instead of crashing?
for me giving a integer value instead of uuid for "var params = <String, dynamic>{ 'id':__" caused this issue
Any solution for this ?
make sure id
is UUID (v4)