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

[FR] Expose `link` / `link_android` in notifications for deep linking

Aperta
#1,142 2 commenti 0 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
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
firebase, java

Direzione di ricerca

Inizia individuando le classi Notification e AndroidNotification e la mappatura del payload dell'HTTP API. Verifica come vengono serializzate le proprietà di notifica esistenti, quindi determina come link e link_android debbano essere mappati su gcm.n.link e gcm.n.link_android. Il lavoro è completo quando i campi ufficialmente supportati producono i payload di notifica deep-link richiesti.

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

Descrizione

needs-triage type: feature request
Problem statement

Deep linking on Android requires the data field in the Intent to be set. As described in this SO post or firebase/firebase-android-sdk#6703, the only way to populate the the field in notifications created automatically by the Firebase Android SDK (when the app is in the background) is by setting the gcm.n.link or gcm.n.link_android keys in data, which have reserved prefixes and are therefore not supposed to be used (although setting them works, at least today).

Originally posted by @lehcar09 in #6703:

Alternatively, we can file a feature request to support the link or link_android field. I’ll get back to you once I hear back from them.

So, this is the FR to officially support these :)

Strawman

A strawman proposal would be to add link properties to the Notification / AndroidNotification classes, which would then be mapped to gcm.n.link / gcm.n.link_android in the JSON payload. Equivalently, in the HTTP API instead of this:

{
  "message": {
    "notification": {
      "title": "Lorem",
      "body": "Ipsum"
    },
    "data": {
      "gcm.n.link": "app://deep/link"
    },
  }
}

It would be this:

{
  "message": {
    "notification": {
      "title": "Lorem",
      "body": "Ipsum",
      "link": "app://deep/link"
    }
  }
}

or this:

{
  "message": {
    "android": {
      "notification": {
        "title": "Lorem",
        "body": "Ipsum",
        "link": "app://deep/link"
      }
    }
  }
}
Alternatives

The workaround suggested here of using setAction doesn't work, because actions needs to be declared in the Android manifest in order to match the intent, which conflicts with dynamically registering deep link targets.

Thanks!

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.