Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

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

Offen
#1,142 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 4 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
45/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Ruhig
Tech-Stack
firebase, java

Rechercherichtung

Beginne damit, die Klassen Notification und AndroidNotification sowie die Zuordnung des HTTP API-Payloads zu finden. Prüfe, wie vorhandene Benachrichtigungseigenschaften serialisiert werden, und ermittle anschließend, wie link und link_android auf gcm.n.link und gcm.n.link_android abgebildet werden sollen. Die Aufgabe ist erledigt, wenn die offiziell unterstützten Felder die erforderlichen Deep-Link-Benachrichtigungs-Payloads erzeugen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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!

Vorherrschende Sprache
Java
Sterne
620
Forks
306
Ø Merge
4 T. 7 Std.
Gemergte PRs (30 T.)
13

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus firebase/firebase-admin-java

Alle Issues in firebase/firebase-admin-java

Ähnliche Issues

Weitere Issues zu Java

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.