Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

FCM - Notification Image not displaying

オープン
#818 コメント 3 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
firebase, java
領域
api, backend

調査の方向性

参照されている src/main/java/com/google/firebase/messaging/Notification.java から始め、その image フィールドをリンク先の Node.js の imageUrl リファレンスと比較します。FCM リクエスト内で Notification がどのように表現されるかを追跡し、その後、提供されている multicast の例を iOS と Android で検証します。通知画像が表示されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

api: messaging
Describe your environment
  • Operating System version: macOS 13.0 (22A380)
  • Firebase SDK version: 9.1.1
  • Library version: 9.1.1
  • Firebase Product: Cloud Messaging (auth, database, storage, etc)
Steps to reproduce:

Images are not displayed on devices (both iOS and Android) when sending notifications with FCM.
I set the image URL using the Notification Builder.

List<String> fcmTokens = List.of(...);

Notification notification = Notification.builder().setTitle("Hello").setBody("world").setImage("https://e-cdns-images.dzcdn.net/images/cover/f2d3db07f3f045a048cdacf53b5cf9dd/250x250-000000-80-0-0.jpg").build();

MulticastMessage message = MulticastMessage.builder()
                .setNotification(notification)
                .addAllTokens(fcmTokens).build();

BatchResponse response = FirebaseMessaging.getInstance().sendMulticast(message);

Note that I receive the notification on the devices, only the image is not displayed. I am able to see the image in the notification when sending it using the Firebase Console.

When investigating the issue, I discovered that other SDKs use imageUrl instead of image attribute.
For example, for NodeJS: https://firebase.google.com/docs/reference/admin/node/firebase-admin.messaging.notification.md#notificationimageurl

The Java SDK still uses the image key instead of imageUrl: https://github.com/firebase/firebase-admin-java/blob/master/src/main/java/com/google/firebase/messaging/Notification.java#L33

主要言語
Java
スター
620
フォーク
305
平均マージ
4日 9時間
マージ済み PR(30日)
4

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

firebase/firebase-admin-java のほかの issue

firebase/firebase-admin-java の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。