Unfortunately, no answer yet. I am checking out postman, I hope I can use that to test quicker.
I manage to send a notification through my app, however, the notification always ends up in the silent notification of my phone, no sound, no vibration and no notification icon in the top left of the phone, only a notification in the drawer when I swipe down :(
In an attempt to fix / improve the situation I tried the following:
Create an android notification channel with id:
high_importance_channel
by using flutter_local_notifications package. The channel was created successful, because requesting an overview of the existing channels, showed the newly created channel (among the other channels). The new channel hasimportance: 5
,enableVibration: true
andplaySound: true
, so that should do the job.Send a FCM through cloud functions with the following code:
const functions = require("firebase-functions"); const admin = require("firebase-admin"); admin.initializeApp(); exports.chatNotification = functions.firestore .document('chats/{groupId}/chat/{chatId}') .onCreate( async (snapshot, context) => { const message = { "notification": { "title": "Message Received", "body": "Text Message from " + fromUserName, }, "tokens": registrationTokens, "android": { "notification": { "channel_id": "high_importance_channel", }, }, }; admin.messaging().sendMulticast(message) .then((response) => { console.log(response.successCount + ' messages were sent successfully'); }); }
But so far not luck, the notification still ends up in the silent notifications. What am I doing wrong?