I got PushKit + Firebase working via node-apn.
Simply install it via npm to your cloud functions folder.
You could get the tokens from your firestore or something like that, but I think that's self-explanatory...
Here is some dummy code:
export const test = functions.https.onRequest((request, response) => {
const config = {
production: false, /* change this when in production */
cert: 'yourCERT.pem',
key: 'yourKey.pem',
};
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!");
});
});
Link to node-apn