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

Abierto
#19,017 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 4 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
dart, flutter

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Dart
Estrellas
9.3k
Forks
4.1k
Merge medio
4 d 17 h
PR fusionados (30 d)
49

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de firebase/flutterfire

Todos los issues de firebase/flutterfire

Issues similares

Más issues de Dart

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.