Skip to content
Back

Misunderstanding Appwrite Messages for Push Notification

  • 0
  • React Native
Skymero
25 Feb, 2026, 19:21

I think I'm having a misunderstanding of how to implement appwrite messages for push notification.

I've already setup firebase credentials in appwrite, but I'm wondering if my workflow is correct. I've been asking chatgpt and it says I need serverside code to run the kotlin code that is listed in https://appwrite.io/docs/products/messaging/send-push-notifications. In my original understanding, I needed to add all of this logic within the same code base. I feel like I'm missing something based on chatgpt telling me that I need to create a server side function. Maybe I'm missing some fundamental understanding for this push notification architecture that I'm not aware of yet.

Can someone help me understand? Here is the pseudocode for my implementation:

User Registration: Getting a Device Token

Trigger: User successfully completes sign-up in

  1. RegistrationPushNotificationHandler() : -Ask the OS for push notification permission using the Firebase Messaging SDK
  • If permission is granted, call messaging().getToken()
  • account.createPushTarget()
  • Save targetId
  1. Set up a token refresh listener using messaging().onTokenRefresh()

Trigger: A user sends a message in the group chat

  1. A push notification is sent to the topic(appwrite mesages) that matches the chat id
  • Because all participants subscribed to the topic in Part 3, sending one message to the topic fans out to all of them automatically Appwrite + FCM handle the fanout
  • Call messaging.createPush() (SendMessageNotifHandler.kt) with the payload generated after message
  1. The push travels: Appwrite → Google FCM servers → Android device

On the Android device — background/killed state:

  1. Android OS wakes MessagingService.kt (which extends FirebaseMessagingService)
  2. onMessageReceived(remoteMessage) fires
  3. The notification title, body, and chatId are extracted from the payload
  4. A system tray notification is built with NotificationCompat.Builder
TL;DR
Developers are confused about implementing Appwrite messages for push notifications. They have set up Firebase credentials but are unsure about the workflow. ChatGPT suggests creating a server-side function to run Kotlin code for sending push notifications with Appwrite. The developer realizes the need for server-side logic and seeks clarification on the push notification architecture. Solution: Create a server-side function to handle push notification sending, as mentioned in the Appwrite documentation.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more