integreat-cms icon indicating copy to clipboard operation
integreat-cms copied to clipboard

Display avg delivered messages per topic

Open deen13 opened this issue 7 months ago • 0 comments

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 the FirebaseApiClient and FirebaseDataClient

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


Pull Request Review Guidelines

deen13 avatar Jul 10 '24 15:07 deen13