私はFirbaseから通知を受け取るアプリケーションを開発中です。私がそれらを受け取ると、正しく表示されません。アイコンを変更しようとすると、ランチャーアイコンが表示されます。さらに、ライトとバイブレーションは動作していません。また、inboxStyleも機能していません。別の通知が表示されます。私はNotificationCompat.BuilderとNotification.Builderを試しましたが、それは動作しません。通知を表示する私のコード:Androidスタジオの通知が間違って表示されます
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
NotificationCompat.Builder builder = new NotificationCompat.Builder(getApplicationContext());
builder.setLights(Color.BLUE, 2000, 2000)
.setSmallIcon(R.mipmap.ic_launcher)
.setContentTitle(remoteMessage.getData().get("username"))
.setContentText(remoteMessage.getNotification().getBody())
.setVibrate(new long[]{0,500,0,500})
.setWhen(remoteMessage.getSentTime())
.setAutoCancel(true)
.setStyle(styles)
.setPriority(Notification.PRIORITY_HIGH)
.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION))
.setContentIntent(pendingIntent);
notificationManager.notify(NOTIFICATION_ID, builder.build());
Firebaseが私の通知を上書きする可能性がありますか?
コードは実際に実行されていますか?おそらくあなたが見る通知はシステムによって自動的に作成されるでしょうか? – algrid
私はFirbaseMessagingServiceで通知を受け取ります。通知がすべて送信された場合、通知は –
に送信されますか、またはサービスのonMessageRecievedは自動的に通知を作成して表示しますか? –