integreat-cms
integreat-cms copied to clipboard
Display avg delivered messages per topic
Short Description
This pull request implements a new feature that enables region managers to view the average number of accepted push notifications (news) per region. The user story proposes to display the exact count of devices currently subscribed to a topic, but Firebase provides no API for that.
Open Tasks
- [ ] Test the new service with real data (blocked by #2897)
Proposed Changes
- Add an analytics label to FCM calls (#2897)
- Add a new role (Firebase Cloud Messaging Data Viewer) with the permission
fcmdata.deliverydata.list
to GCP - Implement a service to call the API and calculate the average per region
- Implement caching since the API result should only change once per day
- Extract
_get_access_token
as it is now used by both theFirebaseApiClient
andFirebaseDataClient
Alternative Solutions
- Reverse engineering the call to an unofficial API, but that seems unstable and unreliable for building features. (See: Gist by timrijckaert)
- Storing the instance IDs of registered devices and using the IID endpoint. However, this feature is deprecated, would be challenging to maintain, and could potentially violate user privacy if we store the instance ids.
Resolved issues
Fixes: #589