Two types of notifications are supported in firebase.
- Local Notifications : Notifications from within the app when the application is backgrounded
- Remote Notifications using expo : Notifications which are pushed from server to various clients. For this implementation. Below is the sample flow of notifications:
Note : Notifications using Firebase Cloud Messaging is only supported over Android and is not yet fully stable so it has not been yet included. But is planned in future releases.
A helper has been created under src/utils/notifications.js for managing local and expo push notifications.
- scheduleLocalNotification : Schedule a local notification
- getExpoPushServerToken : Get a token for interacting with expo server to push expo notifications.
For Sample Implementation, Check the container push-notifications under src/js/containers/push-notifications.