Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Handle invalid token responses in FCM

Aperta
#1,064 3 commenti 3 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
30/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
java

Direzione di ricerca

Inizia dalla documentazione collegata sulla gestione dei token Firebase e segui come IncomingHttpResponse diventa una FirebaseMessagingException. Confronta le risposte UNREGISTERED e INVALID_ARGUMENT nell’issue, quindi determina come l’implementazione dovrebbe distinguere i token di registrazione non validi dagli altri errori INVALID_ARGUMENT senza basarsi sulle stringhe dei messaggi.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

api: messaging type: feature request

As per the documentation a token could be invalid if you have two error codes:

  • UNREGISTERED (HTTP 404)
  • INVALID_ARGUMENT (HTTP 400)

However INVALID_ARGUMENTS can be caused by other errors.

At the moment we receive the content below from the IncomingHttpResponse which is also the error message from the FirebaseMessagingException. What we do is to check the string of the message in order to delete these tokens.

Content: {
  "error": {
    "code": 400,
    "message": "The registration token is not a valid FCM registration token",
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.googleapis.com/google.firebase.fcm.v1.FcmError",
        "errorCode": "INVALID_ARGUMENT"
      }
    ]
  }
}

What is the proper way to handle these errors?
Does it make sense to update FirebaseMessagingException to provide more information about which field is invalid or perhaps have a new error code - INVALID_TOKEN? This would remove a lot of unambiguity as to when it is needed to manage the token.

Lingua principale
Java
Stelle
620
Fork
305
Merge medio
4g 9h
PR unite (30g)
4

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di firebase/firebase-admin-java

Tutte le issue di firebase/firebase-admin-java

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.