I am building a server that sends a notification to all the devices who have my app installed. I have setup firebase admin and this is my code:
const serviceAccountCredentials = require('path/to/serviceaccount');
const admin = require('firebase-admin');
admin.initializeApp({
credential: admin.credential.cert(serviceAccountCredentials),
databaseURL: "url here"
});
const messaging = admin.messaging()
var payload = {
notification: {
title: "This is a Notification",
body: "This is the body of the notification message.",
},
condition: 'App Classic Sudoku Android'
};
messaging.send(payload).then((result: any) => {console.log(result)});
console.log("ran");
What I am doing is fairly easy to understand, my question is how do i target the devices who have installed my app to send a cloud message/notification to. I tried every possible phrase to do so in the condition parameter in the payload object, but it didn't work. I couldn't find it in the docs either.
Any help is appreciated