Как отправить Custom pu sh уведомление, когда приложение находится в состоянии Kklled? - PullRequest
0 голосов
/ 05 марта 2020

Мне нужно вот так. Я использовал Accept action. Это работает, когда приложение работает. Но когда я отправляю уведомление, и приложение закрывается, вместо обычного уведомления приходит обычное уведомление.

 NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, id)
                .setDefaults(Notification.DEFAULT_LIGHTS | Notification.DEFAULT_VIBRATE)
                .setSmallIcon(R.mipmap.ic_manager_launcher)
                .setContentTitle(title)
                .setContentText(message)
                .setAutoCancel(true)
                .setStyle(new NotificationCompat.BigTextStyle().bigText(message))
                .setContentIntent(pendingIntent)
                //.setChannelId(id)
                //.setSound(sound)
                .setAutoCancel(true)
                .addAction(R.mipmap.ic_manager_launcher,"Accept",actionIntent)
                .addAction(R.mipmap.ic_manager_launcher,"Reject",pendingIntent);

        notificationManager.notify(0, notificationBuilder.build());
}

`

Android Custom Push Notification

...