notifier
notifier copied to clipboard
Supporting Push Notifications (Firebase)
Synopsis
Given a few destinations or a topic, we should be able to send the requested push notification using Firebase Legacy API.
Legacy API
We may use the airbase Legacy API to send push notifications. The main rationale behind using the Legacy API is the fact that the new API does not support the multicast feature.
Workflow
- [ ] The client builds and populates the message using Protobuf
- [ ] Then it pushes the new notification request to
notifier.notifications.push
topic - [ ] General listener received the notification request and dispatches to the
Notifier
implementation responsible for handling the push notifications. - [ ] The
Notifier
implementation validates the requests and sends the notification to its intended destinations.
Requirements
- [x] Create the necessary Protobuf spec.
- [ ] Implement the
PushNotifier
References
Additional Info
When we're sending a notification to a single topic, Firebase returns a JSON result with the following schema:
{
"message_id" // The topic message ID.
"error" // Error that occurred when processing the message.
}
Also, if we send a multicast or unicast message via registration tokens, the JSON schema would be something like:
{
"multicast_id" // Unique ID (number) identifying the multicast message.
"success" // Number of messages that were processed without an error.
"failure" // Number of messages that could not be processed.
"results" // Array of objects representing the status of the messages processed.
}