I'm developing an app that can receive push notifications. In my nodejs serve sourcecode, I create a notification thanks to the 'firebase-admin' library. I use ionic/cordova-phonegap-plugin-push for the reception of said notifications.
I also managed to make the notifications stack themselves like Gmail notifications, or Discord notifications, etc... (ONE notification containing MULTIPLE notifications) using the 'style':'inbox'
and 'summaryText'
properties. Here is the message object I create in the backend nodejs server :
const admin = require('firebase-admin');
let message = {
token: user.deviceId,
data: {
title: notification.title,
body: status,
style: 'inbox',
summaryText: 'You have %n% new notifications',
contentAvailable: 'true',
type, // custom data I need
targetId // custom data I need
},
android: { // android configuration
priority
},
apns: { // ios configuration
headers: {
apnsPriority
}
}
}
console.log("message", message);
admin.messaging().send(message)...
My first issue was that if the app is either killed or in the background, when you open it, with or without taping the stacked notifications, I only get the last notification received in the push.on('notification')
phonegap event...
If there's a way to get ALL stacked notifications, I'm all ears, cause it don't seem like it's possible...
That's why I have another issue : as I can't get all notifications data, I would like to set a priority so that when I tap on the stacked notifications, I get the datas from the notification with the HIGHEST priority...
As you can see I've set priority variables for both Android and iOS but it doesn't seem to work... I'm only testing on Android right now.
I've asked my dear friend Google for the past 4hours without finding the answer... Is there a solution to this kind of issue ?
Thanks in advance for your help :)