
Hi! I am trying to send push notifications from Appwrite console on a self-hosted environment to native applications using FCM. While the service works fine, and the application will receive notifications both in foreground and background, notifications received while the app is in foreground contain no message or title. I've been troubleshooting this for a bit, and found that the payload sent to FCM services is missing a data field in the object. While taking a brief look through the UTOPIA PHP adapter used for messaging in Appwrite, specifically in the FCM class, I noticed this is indeed the case. The class is found here: https://github.com/utopia-php/messaging/blob/main/src/Utopia/Messaging/Adapter/Push/FCM.php
Take a look at the bare example of the expected payload below, to see which fields are mapped to which Application state.
{
"message": {
"token": "some-token",
"notification": {
"title": "Works in background",
"body": "This message is successfully received while app is in background."
},
"android": {
"priority": "high",
"data": {
"title": "This title is visible while the app is in foreground.",
"message": "This message will be seen in the push notification while the app is in foreground."
}
},
"data": {
"href": "chat"
}
}
}

Hello! Thanks a lot! Can you create an issue on GitHub so the team takes a look into it?
Recommended threads
- Email OTP Mail Getting Delayed by 10 min...
I just noticed I am reciving delayed otp emails on frankfurt server we are on free plan now but we are planning to change to get on to paid plan can anyone plea...
- No Targets Created For Email OTP Users
I use OTP for my users. All emails are verified. No one has their email as a target. What am I doing wrong? The documentation says the targets should be created...
- DigitalOcean Droplet SMTP failure with m...
Is there any way to get the appwrite 1.6 mailer docker image working on a droplet? I can send emails via the appwrite console, but my magiclinks always fiail wi...
