flutter_callkit_incoming icon indicating copy to clipboard operation
flutter_callkit_incoming copied to clipboard

pushkit not working on release mode

Open Mohammadfazel03 opened this issue 1 year ago • 19 comments

the pushkit when app in background is not working in release mode ios but in debug mode is work correctly ios 12 pushkit version 2.0.0+1

Mohammadfazel03 avatar Jun 19 '23 07:06 Mohammadfazel03

have same problem iphone 11 ios 16 pushkit version 2.0.0+1

ForesThule avatar Jun 20 '23 11:06 ForesThule

The same thing with iPhone 11 iOS 16, same version. Any thoughts @hiennguyen92 ?

xdr-kzh avatar Jun 20 '23 20:06 xdr-kzh

can you tell me in more detail are you using FCM or any service for push VoIP? any logs? or whatever you see? or any screenshot or record video screen?

hiennguyen92 avatar Jun 21 '23 11:06 hiennguyen92

@Mohammadfazel03 if you are using FCM , they don't work in background when app is closed. If you are using VOiP , check your payload , probably you send request to sandbox instead of production server

stryder123451 avatar Jul 19 '23 07:07 stryder123451

Same issue with iOS. Not working in release mode. Production environment is set. Getting 200 response code from server, but not showing in device. It is working without issues in developer mode.

jerrypaulsam avatar Jul 19 '23 10:07 jerrypaulsam

Same issue with iOS. Not working in release mode. Production environment is set. Getting 200 response code from server, but not showing in device. It is working without issues in developer mode.

Did you use @(pragma vm-entry) in code?

stryder123451 avatar Jul 19 '23 11:07 stryder123451

Yes, I did.

jerrypaulsam avatar Jul 19 '23 15:07 jerrypaulsam

Yes, I did.

Could you show your link to apple api?

stryder123451 avatar Jul 19 '23 19:07 stryder123451

This is the url https://api.push.apple.com:443 for production. I am getting a success response everytime I send the notification but not showing up in device.

jerrypaulsam avatar Jul 20 '23 04:07 jerrypaulsam

Did anyone solve this issue?

jerrypaulsam avatar Jul 21 '23 06:07 jerrypaulsam

Did anyone solve this issue?

@hiennguyen92 Also, on iOS 15 VoiP notifications doesn't appear

stryder123451 avatar Jul 26 '23 09:07 stryder123451

@jerrypaulsam @hiennguyen92
i changed pushkit init in AppDelegate from:

let mainQueue = DispatchQueue.main

to:

let mainQueue = DispatchQueue(label: "mySerialqueue", attributes: [], target: nil)

  And it starts work on iOS 15 in terminated state , i don't confident on 100% percent it still needs testing

stryder123451 avatar Jul 26 '23 10:07 stryder123451

@stryder123451 I haven't tested this, but sometimes during terminated state, I receive calls, but instead of the caller name, it is showing some token or a very long string. This happens only in terminated state.

jerrypaulsam avatar Jul 26 '23 15:07 jerrypaulsam

@stryder123451 I haven't tested this, but sometimes during terminated state, I receive calls, but instead of the caller name, it is showing some token or a very long string. This happens only in terminated state.

I notice this bug on iOS lower 16 version, try my solution i hope it will help you

stryder123451 avatar Jul 26 '23 16:07 stryder123451

@jerrypaulsam @hiennguyen92 i changed pushkit init in AppDelegate from:

let mainQueue = DispatchQueue.main

to:

let mainQueue = DispatchQueue(label: "mySerialqueue", attributes: [], target: nil)

  And it starts work on iOS 15 in terminated state , i don't confident on 100% percent it still needs testing

I have not checked on this. i will check it out. if it is the problem, i will update the document.

hiennguyen92 avatar Jul 26 '23 16:07 hiennguyen92

@jerrypaulsam @hiennguyen92 i changed pushkit init in AppDelegate from: let mainQueue = DispatchQueue.main to: let mainQueue = DispatchQueue(label: "mySerialqueue", attributes: [], target: nil)

  And it starts work on iOS 15 in terminated state , i don't confident on 100% percent it still needs testing

I have not checked on this. i will check it out. if it is the problem, i will update the document.

Thanks, i hope it helpls

stryder123451 avatar Jul 27 '23 08:07 stryder123451

This issue still haunts me. It isn't working properly with production app. The problem is inconsistency. It working randomly. Sometimes it works, and sometimes it doesn't.

By the way, apns server response is 200 and it is working fine. The problem is with the device failing to receive it.

@hiennguyen92 , @stryder123451 Do you have any suggestions?

Thanks

jerrypaulsam avatar Aug 03 '23 13:08 jerrypaulsam

Hello all I have the same issue the call notification not working in background

I am using by fcm notification so when i receive notification from firebase I call the function to active callkit dialog in background in debugging it's working but in testflight and release mode in ios not working

can you help me to fix this issue please

this my code to receive the calls @pragma("vm:entry-point") Future myBackgroundMessageHandler(RemoteMessage message) async { debugPrint('Handling a background message'); // Handle the message here if(message.notification==null) { if(message.data['status']=="groupCall"){ String roomName= message.data['groupId']; showCallkitIncoming(roomName, message.data); readyForReceiveCalls = false; } else if(message.data['status']=="calling") { String roomName= Controller().sortUserIds(message.data['calleeId'], message.data['callerId']); showCallkitIncoming(roomName, message.data); readyForReceiveCalls = false; } else if(message.data['status']=="callCancelled"){ FlutterCallkitIncoming.endAllCalls(); readyForReceiveCalls = true; currentUuid=null; } } }

notes: i redirect the user to webpage when accept the call

and i am sure the app receive the notifications when be in background but the callkit notification not working in release mode

and I am added this permissions in .plist file fetch remote-notification voip

did i needed any other permissions or what the missing in my implementation
and about the <string>voip</string> it's required in my case? till i am not use any voip feature because i create the calls in webpages

amerhajali2000 avatar Sep 14 '23 12:09 amerhajali2000

Any solution on this?

delwar36 avatar Sep 26 '23 13:09 delwar36