[firebase_messaging] Android: messages sent to the FID from register() fail with UNREGISTERED; iOS works

Open
#19,017 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 4 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
dart, flutter

Research direction

Start by tracing FirebaseMessaging.instance.register() and the Android onRegistered path that returns the FID; compare it with the iOS registration flow, which the report says works. Reproduce with the listed manifest setting and send an HTTP v1 message to the returned FID. Done means Android FID registration supports delivery without the reported 404 UNREGISTERED response.

Written by the indexing model from the issue text.

Description

Needs Attention platform: android plugin: messaging type: bug
Is there an existing issue for this?
  • I have searched the existing issues.
Which plugins are affected?

Messaging

Which platforms are affected?

Android

Description

With FID-based registration (FirebaseMessaging.instance.register() + onRegistered), every FCM HTTP v1 send to the FID returned on Android fails with 404 UNREGISTERED (messaging/installation-id-not-registered).

Reproducing the issue
  1. Add to AndroidManifest.xml:
  2. In Dart:
    FirebaseMessaging.instance.onRegistered.listen((fid) => sendToBackend(fid));
    await FirebaseMessaging.instance.register();
  3. Send an FCM HTTP v1 message to that FID (firebase-admin send({ fid, notification }) or a direct REST call).
  4. → 404 UNREGISTERED. The same steps on iOS (FirebaseMessagingInstallationIdEnabled = true in Info.plist) deliver the message.
Firebase Core version

5.2.0

Flutter Version

3.50.1

Relevant Log Output
# Device (adb logcat, FirebaseMessaging VERBOSE)
D/FirebaseMessaging: Invoking onNewToken for app: [DEFAULT]
D/FirebaseMessaging: onServiceConnected: ComponentInfo{<package>/io.flutter.plugins.firebase.messaging.FlutterFirebaseMessagingService}
I/flutter: FID: <FID>

# Server (firebase-admin)
code: messaging/installation-id-not-registered
{
  "error": {
    "code": 404,
    "message": "NotRegistered",
    "status": "NOT_FOUND",
    "details": [{ "@type": "type.googleapis.com/google.firebase.fcm.v1.FcmError", "errorCode": "UNREGISTERED" }]
  }
}
Flutter dependencies
Expand Flutter dependencies snippet
firebase_core 5.2.0
firebase_core_platform_interface 8.2.0
firebase_messaging 17.1.0
firebase_messaging_platform_interface 4.12.0
Additional context and comments

Device: OnePlus 6T, Android 15, Google Play services 26.45.31.

Dominant language
Dart
Stars
9.3k
Forks
4.1k
Avg merge
4d 17h
Merged PRs (30d)
49

Getting set up

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.

More from firebase/flutterfire

All issues in firebase/flutterfire

Similar issues

More Dart issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.