RocketChat / RocketChat/Rocket.Chat.ReactNative

Send FCM push message as labeled data messages, so they show up in Firebase Cloud Messaging Reports

Open
#2,515 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.4k
Forks
1.5k
Avg merge
1d 18h
Merged PRs (30d)
90

Description

Description:

As of 3.6.3, FCM push notifications are sent without analytics label, meaning they don't show up in Firebase Cloud Reports.
Propose to add (meaningful) analytics labels, so they show up in Firebase Cloud Reports, for analytics purpose or for troubleshooting/diagnostics purposes.

Reference: https://firebase.google.com/docs/cloud-messaging/understand-delivery?authuser=0#adding_analytics_labels_to_messages

Steps to reproduce:
  1. Ensure you set your own FCM account
  2. Sign in with Android mobile app
  3. Close the app (make it in background)
  4. Send a message from another user
  5. Notice that push notification is received
  6. Go to Firebase Cloud Reports
Expected behavior:

You get 1 data point, with at least 1 Send and 1 Receive, and probably 1 Impression and 1 Open.

Actual behavior:

No data:

image

Server Setup Information:
  • Version of Rocket.Chat Server: 3.6.3
  • Operating System: linux x64 4.14.193-149.317.amzn2.x86_64
  • Deployment Method: AWS Fargate (Docker)
  • Number of Running Instances: 1
  • DB Replicaset Oplog: local
  • NodeJS Version: 12.6.1
  • MongoDB Version: 4.2.9
Client Setup Information
  • Desktop App or Browser Version: Rocket.Chat.ReactNative for Android 4.10.0
  • Operating System: Android 10
Additional context
Relevant logs:
I20200929-11:57:30.171(0) server.js:204 Push ➔ debug sendGCM [   'fkhBWgHdTBS...RLX-k6' ] {   createdAt: 2020-09-29T11:57:30.162Z,   createdBy: '<SERVER>',   sent: false,   sending: 0,   from: 'push',   title: '#ATG-test',   text: 'hendy: Cek',   userId: 'RejdvL7N9tgtAhHHs',   payload: {     host: 'https://chat.soluvas.com/',     messageId: 'YR2ITYBVY2XaVI2VR',     notificationType: 'message',     rid: 'SAPhPv73kzD7c5vY3',     sender: { _id: 'WF888NBfytPJMnuu2', username: 'hendy' },     type: 'p',     name: 'ATG-test'   },   badge: 2,   sound: 'default',   notId: 1633641473,   apn: { category: 'MESSAGE' },   gcm: {     image: 'https://chat.soluvas.com/images/logo/android-chrome-192x192.png',     style: 'inbox'   },   image: 'https://chat.soluvas.com/images/logo/android-chrome-192x192.png',   style: 'inbox' } 

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no implementation file or test. Start with the referenced Firebase Cloud Messaging analytics-label documentation, then locate the React Native FCM message-sending entry point and verify the change by checking that sent notifications produce data in Firebase Cloud Reports.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, firebase, react-native, typescript
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.