penn-mobile-android
penn-mobile-android copied to clipboard
Introducing Notifications
Our app can receive notifications now!
Changes
- Using FCM, our app could receive notifications by sending their FCM Registration token, a device-based token that can be used by admin to send notifications by FCM service, to the backend.
- For every new token generated, we would store/update it in
SharedPreferences
. Therefore, to fetch notification tokens, we can easily do so readingSharedPreferences
. - Currently, we implemented network requests by posting the registration token to the backend so they can send notifications as admin and deleting the registration token from the backend so users won't receive notifications when they are logged out.
- There are more to come. For now, this implementation would be sufficient to send pca notifications by the add/drop period. We would add new notification preferences (so users can customize what notifications they want to receive) as new notifications are being introduced. @Divak2004 is working on the settings UI.
Documentation and Testing:
- Firebase Notification Testing Console: https://console.firebase.google.com/project/penn-mobile-android/notification/compose
- About FCM Messages: https://firebase.google.com/docs/cloud-messaging/concept-options
- Receive Messages in an Android App: https://firebase.google.com/docs/cloud-messaging/android/receive