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
- RegistrationPushNotificationHandler() : -Ask the OS for push notification permission using the Firebase Messaging SDK
- If permission is granted, call
messaging().getToken() - account.createPushTarget()
- Save
targetId
- Set up a token refresh listener using
messaging().onTokenRefresh()
Trigger: A user sends a message in the group chat
- 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
- The push travels: Appwrite → Google FCM servers → Android device
On the Android device — background/killed state:
- Android OS wakes MessagingService.kt (which extends
FirebaseMessagingService) onMessageReceived(remoteMessage)fires- The notification title, body, and
chatIdare extracted from the payload - A system tray notification is built with
NotificationCompat.Builder
Recommended threads
- Sub-minute server-side execution for rea...
Hey — I'm building a real-time auction app on Appwrite Cloud and running into a timing limitation I'd please love some clarity on. My use case: when a bidding ...
- Function issue
Hi,idk whats wrong with my function but i made some changes to the env var and made sure they saved then i redeployed it,but then after it redeeployed it asked ...
- Can't resume paused project
I have logged in in incognito, done the email verification and still get the invalid fingerprint error. What's the issue.