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
- updateSession isn't working for google o...
I'm building an app using react native with expo. An image of my code is attached. The code is a useEffect that i have in a context that wraps the root layout ...
- How to allow redirects from other URLs o...
I'm trying to implement google login in react native but the company I work for uses self hosted appwrite, and I always get the invalid success param error
- Google OAuth2 Login on Expo/React Native...
Does anyone has a guide on how to implement this on a Expo project? I've been trying to implement it, used AI and etc but can't. 1. Do I have to have a domain/...