flutter_callkit_incoming icon indicating copy to clipboard operation
flutter_callkit_incoming copied to clipboard

App crashes on ios when showing call via fcm

Open abdulkash opened this issue 2 years ago • 9 comments

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

abdulkash avatar Jul 30 '22 00:07 abdulkash

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:(

amani27 avatar Jul 30 '22 10:07 amani27

yeah i was trying in on a real device but it works very well when using pushkit

abdulkash avatar Aug 10 '22 12:08 abdulkash

pushkit

Did you end up using native solution? Or is it some other plugin you're talking about? @abdulkash ?

amani27 avatar Aug 10 '22 14:08 amani27

Yeah

abdulkash avatar Aug 16 '22 15:08 abdulkash

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.

henriquetroiano avatar Oct 07 '22 00:10 henriquetroiano

There is 2 main types of push notifications: VoIP push and regular push. Got it ?

henriquetroiano avatar Oct 07 '22 00:10 henriquetroiano

@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.

henriquetroiano avatar Oct 07 '22 00:10 henriquetroiano

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?

beebobox avatar Oct 11 '22 10:10 beebobox

for me giving a integer value instead of uuid for "var params = <String, dynamic>{ 'id':__" caused this issue

kevinZartek avatar Oct 19 '22 16:10 kevinZartek

Any solution for this ?

arslankaleem7229 avatar Nov 02 '22 07:11 arslankaleem7229

make sure id is UUID (v4)

hiennguyen92 avatar Dec 21 '22 12:12 hiennguyen92