Skip to content

hotfix/cp-11369-android-fcm-token-retrieval-fails-on-latest-firebase-flutter#343

Merged
snuricp merged 2 commits intomasterfrom
hotfix/cp-11369-android-fcm-token-retrieval-fails-on-latest-firebase-flutter
Apr 17, 2026
Merged

hotfix/cp-11369-android-fcm-token-retrieval-fails-on-latest-firebase-flutter#343
snuricp merged 2 commits intomasterfrom
hotfix/cp-11369-android-fcm-token-retrieval-fails-on-latest-firebase-flutter

Conversation

@unnaticleverpush
Copy link
Copy Markdown
Contributor

@unnaticleverpush unnaticleverpush commented Apr 17, 2026

Fix FCM token retrieval for latest Firebase and add safe fallback handling


Summary by cubic

Fixes Android FCM token retrieval on the latest Firebase by calling FirebaseMessaging.getToken() first and only falling back to FirebaseInstanceId if the class exists. Returns null when neither path is available to avoid crashes. Addresses Linear CP-11369.

  • Bug Fixes
    • Invoke FirebaseMessaging.getInstance().getToken() via reflection and Tasks.await(...).
    • Add isFirebaseInstanceIdAvailable() check; only use FirebaseInstanceId.getToken(...) when present; otherwise warn and return null.
    • Improve logging by including caught exceptions and explicit fallback failure messages.
    • Simplify reflection and rethrow specific exceptions in getTokenWithClassFirebaseMessaging().

Written for commit b1f2d7c. Summary will update on new commits.

…flutter

Fix FCM token retrieval for latest Firebase and add safe fallback handling
@unnaticleverpush unnaticleverpush self-assigned this Apr 17, 2026
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

@snuricp snuricp merged commit 9770bba into master Apr 17, 2026
3 of 5 checks passed
@snuricp snuricp deleted the hotfix/cp-11369-android-fcm-token-retrieval-fails-on-latest-firebase-flutter branch April 17, 2026 13:01
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.

2 participants