Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#1,142 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
45/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
firebase, java
Lĩnh vực
api, backend-api-design

Hướng nghiên cứu

Bắt đầu bằng cách xác định các lớp Notification và AndroidNotification cùng với ánh xạ payload của HTTP API. Xem lại cách các thuộc tính thông báo hiện có được tuần tự hóa, sau đó xác định cách link và link_android cần được ánh xạ tới gcm.n.link và gcm.n.link_android. Hoàn thành khi các trường được hỗ trợ chính thức tạo ra các payload thông báo deep-link bắt buộc.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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!

Ngôn ngữ chính
Java
Star
620
Fork
305
Merge trung bình
4 ngày 9 giờ
Pull request đã merge (30 ngày)
4

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của firebase/firebase-admin-java

Tất cả issue của firebase/firebase-admin-java

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.