0

スタックされた通知は、アプリケーションが開いている場合は機能しますが、アプリケーションが閉じている場合は機能しません。アプリが閉じていると、アイコンが正しく表示されず、通知は積み重ねられませんか?アプリのバックグラウンドである場合には、Googleのサービスは、あなたのメッセージを表示するの世話をする場合はアプリがフォアグラウンドにあるときFirebase通知については閉じたアプリケーションで積み重ねられた通知が機能しない

notification = new NotificationCompat.Builder(this); 
notification.setContentTitle(notifyFromName); 
notification.setContentText(notifyMsg); 
if (!msgIsProj) { 
    String followText = notifyMsg + " you!"; 
    notification.setContentText(followText); 
    notification.setGroup(GROUP_KEY_FOLLOWERS); 

    Log.d(Constants.DEBUG, "SETTING AS FOLLOWers" + unread_notif); 
} else { 

    notification.setContentText(notifyMsg + " " + notifyItemName); 
    notification.setGroup(GROUP_KEY_PROJECTS); 
} 
notification.setTicker(getString(R.string.titlePushNotify)); 
notification.setSmallIcon(R.drawable.ic_pushnotify); 
//notification.setGroupSummary(true); 
PendingIntent contentIntent = PendingIntent.getActivity(this, id, 
     newIntentMsg, PendingIntent.FLAG_CANCEL_CURRENT); 
notification.setContentIntent(contentIntent); 
notification.setAutoCancel(true); 
manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); 
if(notifyMsg != null && !notifyMsg.equals("")) { 

    manager.notify(id, notification.build()); 

    unread_notif++; 

    Log.d(Constants.DEBUG, "PRE MORE NOTIF" + unread_notif); 
    if (unread_notif>1) { 
     Log.d(Constants.DEBUG, "GETTING MORE NOTIF" + unread_notif); 
     Notification summaryNotification = new NotificationCompat.Builder(this) 
       .setContentTitle("Your summary message") 
       .setSmallIcon(R.drawable.ic_pushnotify) 
       .setStyle(new NotificationCompat.InboxStyle() 
         .addLine("Details about your first notification") 
         .addLine("Details about your second notification") 
         .setBigContentTitle(Integer.toString(unread_notif)+" new notifications") 
         .setSummaryText("More details in app")) 
       .setGroup(GROUP_KEY_FOLLOWERS) 
       .setGroupSummary(true) 
       .build(); 

     manager.notify(id++, summaryNotification); 
    } 
} 

答えて

0

は、onMessageReceiveが呼び出されます。

は、ここに私のコードです。 - 通知ペイロード - データペイロードをフォアグラウンドでアプリがデータペイロードを使用してバックグラウンドでアプリやが殺されたときにそれらが処理される通知ペイロードを使用している場合

通知が管理されている :今の通知は、次の2つの方法を使用して処理され

したがって、このソリューションは、メッセージペイロードから通知オブジェクトを削除します。バックエンドで通知オブジェクトを削除すると、この問題に直面しなくなるので、データペイロードオブジェクトがデフォルトとして考慮されます。

関連する問題