Closed esDotDev closed 4 years ago
For reference, this is what I'm after: https://javapapers.com/android/android-bundled-notifications/
@iapicca This is really needed in a messaging app, as WhatsApp does.
Reading the docs, my best guess is to link the plugin to Android project and then handle background messages:
A basic version of this would be to specify threadId
for APNs and collapseKey
for Android when sending your FCM messages from your backend service, for example with the Firebase Admin SDK for Node.js you'd do something like:
await admin.messaging().send({
token: 'YOUR_TOKEN_HERE',
apns: {
payload: {
aps: {
threadId: 'foo',
alert: 'Hello world',
},
},
},
android: {
collapseKey: 'foo',
notification: {
title: 'Hello world',
},
},
});
For the full style though on Android you need to create notifications using the Inbox Style notification style. For this I'd recommend sending data only messages through FCM and then using a local notifications plugin to build an Inbox Style notification from your FCM message data.
I'd like to group notifications like Hangouts does, where multiple messages are grouped together in one notification but I can't figure out how. From what I've read, this is a client-side implementation detail.
Here's my example payload: