Closed abdo400 closed 1 year ago
I am using fcm push notifications to trigger call both in android and ios. In android it works even when the app is in background, but in ios I am getting push notification but call kit ui is not triggered. Do we need to implement push kit even if fcm package is used ? if yes, I have read pushkit.md file and i have covered steps upto generating .p12 file. After that what exactly should I do ?
So I managed to make this work. Here is what you need to do. The AppDelegate.Swift file that is provided in the example for this package is working fine. What you need to do is actually send an APNs notification, instead of the FCM we are all using.
I am using google cloud functions as a backend, so I installed this package https://www.npmjs.com/package//node-apn and I am now sending the notification with the token I got from this call FlutterCallkitIncoming.getDevicePushTokenVoIP();
. And everything is working fine. Using FCM won't work, or at least it didn't with mine.
A good indicator that the APNs notification is working is when you see this didReceiveIncomingPushWith
printing in your console. It is called from the pushRegistry
if you followed the AppDelegate.swift example.
The example: https://github.com/hiennguyen92/flutter_callkit_incoming/blob/master/PUSHKIT.md
You can also test if your AppDelegate push integration is working correctly or not by using this app. https://github.com/onmyway133/PushNotifications
This is for iOS. The call notification is working okay when the app is in debug mode. Meaning I am using
fluttter run
command. And when using Xcode,Wait for the executable to be launched
to test terminated state. It works after the second call. So the first two calls only show the firebase notification but not callkit calling widget notification.But in release mode, background and terminated states don't work at all.
My notification payload is like that:
I am using firebase messaging. I have already added the APNs auth key to the firebase messaging backend.
For AppDelegate.swift, I am using the exact one the example provides.