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
- SMTP Issue in Coolify for Appwrite - Wro...
I’ve configured SMTP in Coolify for my Appwrite instance with the sender email contact@foot224.app. However, when I try to send a "reset password" email, it fai...
- Can't send email to users
I used same smtp info in 2 projects. One works for sending reset or any email. But another one doesn't. It says failed when i try to send email from cloud from...
- SMTP SERVER CONFIGURED BUT NO EMAILS
in my self hosted appwrite, I have configured appwrite smtp with my hostinger email. but from frontend/client side it is not sending any emails + no logs and if...