私のAndroidアプリには小さな問題があります。 FCMから通知を受け取り、プッシュ通知として表示します。これまでのところすべてが機能していますが、奇妙な問題は、アイコンが白く、時にはカラフルなことがあることです。Androidの通知アイコンの色が時には白く、時にはカラフルです
アプリが画面上で開いていて、この瞬間にプッシュ通知を受け取ると、カラフルなプッシュ通知が画面上部に表示されます。
アプリが終了すると、プッシュ通知が白いアイコンで表示されます。
私はscreenhot付属している:ここで Screenshot
は、プッシュ通知が作成されたコードスニペット、次のとおりです。
Notification.Builder notificationBuilder = new Notification.Builder(this)
.setSmallIcon(android.R.drawable.ic_dialog_alert)
.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher))
.setAutoCancel(true)
.setVisibility(Notification.VISIBILITY_PUBLIC)
.setPriority(Notification.PRIORITY_HIGH)
.setColor(Color.parseColor("#83c3ed"))
.setLights(Color.RED, 1000, 500)
.setSound(defaultSoundUri)
.setContentIntent(pendingIntent);
Notification.InboxStyle inboxStyle = new Notification.InboxStyle();
inboxStyle.setBigContentTitle("WetterApp");
inboxStyle.addLine(notification.getTitle());
inboxStyle.addLine(notification.getBody());
notificationBuilder.setStyle(inboxStyle);
NotificationManager notificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(0, notificationBuilder.build());
私のモバイルデバイスは、Android 6.0.1、私のSDKバージョンがされています23.
ありがとうございます。
あなたはAndroidのすべてのバージョンでシルエットを使用していたはずです - アプリアイコンは、使用するのに適した小さなアイコンではありませんでした。 – ianhanniballake
少なくとも、http://stackoverflow.com/a/29207365/976367からの回答があることを述べてください –