[PR #3176] [MERGED] [PM-7631] Handle new FCMv1 format #34574

Closed
opened 2026-04-21 02:07:19 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/3176
Author: @vvolkgang
Created: 4/19/2024
Status: Merged
Merged: 4/22/2024
Merged by: @kspearrin

Base: mainHead: fcmv1


📝 Commits (5)

📊 Changes

1 file changed (+26 additions, -5 deletions)

View changed files

📝 src/App/Platforms/Android/Push/FirebaseMessagingService.cs (+26 -5)

📄 Description

Type of change

  • Bug fix
  • New feature development
  • Tech debt (refactoring, code cleanup, dependency upgrades, etc)
  • Build/deploy pipeline (DevOps)
  • Other

Objective

Google is deprecating their legacy FCM endpoints (GCM), so migrate to FCMv1 as outlined by Microsoft:

https://learn.microsoft.com/en-us/azure/notification-hubs/notification-hubs-gcm-to-fcm

ref: https://github.com/bitwarden/server/pull/3917

(old) GCM format:

{
  "data": {
    "data": {
      "type": 1,
      "payload": "JSON_Data"
    }
  }
}

(new) FCM format:

{
  "message": {
    "data": {
      "type": "1",
      "payload": "JSON_Data"
    }
  }
}

Code changes

  • FirebaseMessagingService.cs: Update remote message parsing to account for GCM and FCM message formats. GCM is detected and kept as-is. FCM is detected and re-constructed into a JObject to match the existing GCM format.

Before you submit

  • Please check for formatting errors (dotnet format --verify-no-changes) (required)
  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/3176 **Author:** [@vvolkgang](https://github.com/vvolkgang) **Created:** 4/19/2024 **Status:** ✅ Merged **Merged:** 4/22/2024 **Merged by:** [@kspearrin](https://github.com/kspearrin) **Base:** `main` ← **Head:** `fcmv1` --- ### 📝 Commits (5) - [`d6e4f05`](https://github.com/bitwarden/android/commit/d6e4f05e9c5cb766563cc296ebe0f6b497dbae7e) handle new FCMv1 format - [`bfeb2c8`](https://github.com/bitwarden/android/commit/bfeb2c8a0fc52c485c336b33e26e8dd7bfde9c2b) optimizations - [`cf152f7`](https://github.com/bitwarden/android/commit/cf152f7f9dce64d47bfd707b404438d8111f91e0) restore formatting - [`b033ba6`](https://github.com/bitwarden/android/commit/b033ba6fc9a7f4b713e79d91a57daa60ee096ebb) revert formatting - [`3d3cad6`](https://github.com/bitwarden/android/commit/3d3cad6ca6a330d67ab77d11d3624d5a789e18a0) revert formatting ### 📊 Changes **1 file changed** (+26 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/App/Platforms/Android/Push/FirebaseMessagingService.cs` (+26 -5) </details> ### 📄 Description ## Type of change - [ ] Bug fix - [x] New feature development - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [ ] Other ## Objective Google is deprecating their legacy FCM endpoints (GCM), so migrate to FCMv1 as outlined by Microsoft: https://learn.microsoft.com/en-us/azure/notification-hubs/notification-hubs-gcm-to-fcm ref: https://github.com/bitwarden/server/pull/3917 (old) GCM format: ``` { "data": { "data": { "type": 1, "payload": "JSON_Data" } } } ``` (new) FCM format: ``` { "message": { "data": { "type": "1", "payload": "JSON_Data" } } } ``` ## Code changes <!--Explain the changes you've made to each file or major component. This should help the reviewer understand your changes--> <!--Also refer to any related changes or PRs in other repositories--> * **FirebaseMessagingService.cs:** Update remote message parsing to account for GCM and FCM message formats. GCM is detected and kept as-is. FCM is detected and re-constructed into a JObject to match the existing GCM format. ## Before you submit - Please check for formatting errors (`dotnet format --verify-no-changes`) (required) - Please add **unit tests** where it makes sense to do so (encouraged but not required) - If this change requires a **documentation update** - notify the documentation team - If this change has particular **deployment requirements** - notify the DevOps team --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-21 02:07:19 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#34574