Skip to content

fix: [SDK-4946] support Firebase 25.1 FID registration - #2697

Closed
fadi-george wants to merge 3 commits into
mainfrom
fadi/sdk-4946
Closed

fix: [SDK-4946] support Firebase 25.1 FID registration#2697
fadi-george wants to merge 3 commits into
mainfrom
fadi/sdk-4946

Conversation

@fadi-george

Copy link
Copy Markdown
Contributor

Description

One Line Summary

Support FCM registration when Firebase Installation ID registration is enabled.

Details

Motivation

Firebase Messaging 25.1 disables getToken() when FID registration is enabled, preventing OneSignal push registration. Fixes #2696.

Scope

Falls back to register() and returns the Firebase Installation ID only when Firebase reports that the legacy API is disabled. Firebase Messaging 23.x and 24.x behavior remains unchanged.

Testing

Unit testing

Added coverage for legacy token retrieval, FID registration, and unrelated error propagation. Verified against the default Firebase 24.0.0 dependency and Firebase 25.1.1. Notifications unit tests, Spotless, Detekt, and the release build pass. Android lint remains blocked by two unrelated existing errors in SamsungHomeBadger.java and SummaryNotificationDisplayer.kt.

Manual testing

Not run on a physical device. The affected registration branches are covered with deterministic unit tests.

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
  • I have reviewed this PR myself, ensuring it meets each checklist item

@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

📊 Diff Coverage Report

Diff Coverage Report (Changed Lines Only)

Gate: aggregate coverage on changed executable lines must be ≥ 80% (JaCoCo line data for lines touched in the diff).

Changed Files Coverage

  • PushRegistratorFCM.kt: 0/31 touched executable lines (0.0%) (55 touched lines in diff)
    • 31 uncovered touched lines in this file

Overall (aggregate gate)

0/31 touched executable lines covered (0.0% — requires ≥ 80%)

Per-file detail (informational; gate is aggregate above):

  • PushRegistratorFCM.kt: 0.0% (31 uncovered touched lines)

❌ Coverage Check Failed

Aggregate coverage on touched lines is 0.0% (minimum 80%).

📥 View workflow run

FCM v1 mints the installation ID against the project in FirebaseOptions but
registers it under the sender ID, so the two must belong to the same Firebase
project. OneSignal's fallback credentials point at a shared project, which the
backend rejects with ApiException 8. Play Services below 261200000 also falls
back to a legacy token that no public API exposes, so returning the FID there
would upload an unroutable token.

Co-authored-by: Cursor <cursoragent@cursor.com>
@fadi-george
fadi-george deleted the fadi/sdk-4946 branch July 28, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: FCM registration fails with "API disabled" when Firebase Installation ID registration is enabled (firebase-messaging 25.1.x)

1 participant