Does Firebase Cloud Messaging support VOIP pushkit services?
This worked for me! Don't forget to add the Authkey_xxxx.p8 file in your directory and don't forget to add .voip to your bundle id in the notification topic.
export const test = functions.https.onRequest((request, response) => {
const config = {
production: false, /* change this when in production */
token: {
key: "./AuthKey_xxxx.p8",
keyId: "xxxx",
teamId: "yyyy"
}
};
const apnProvider = new apn.Provider(config);
const notification = new apn.Notification();
const recepients: string[] = [];
recepients.push(apn.token('SOME PUSHKIT TOKEN'));
recepients.push(apn.token('ANOTHER PUSHKIT TOKEN'));
notification.topic = 'com.your.app.voip'; // you have to add the .voip here!!
notification.payload = {
// some payload
};
return apnProvider.send(notification, recepients).then((reponse) => {
console.log(reponse);
return response.send("finished!");
});
});
At time of writing (FirebaseMessaging 1.1.0/Firebase 3.2.0) FCM uses regular APNs underneath on iOS, so there isn't support for PushKit notifications.