
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
- MFA SMS only brandable on self hosted in...
appwrite.auth.createSMSChallenge(); as triggered by error.type === 'user_more_factors_required' sends an SMS with a six digit code... but the sms is always from...
- Unable to send emails to users on Appwri...
I was trying to set up email verification the day in which there has been a [degradation of realtime and messaging services](https://status.appwrite.online/inci...
- Email Messages sent by functions stuck o...
Hello, I have a function that sends email messages and it appears that the messages are created, but get stuck on processing. Sending an email manually seems t...
