내 앱에서 밀어 넣기 알림을 사용하고 있습니다.하지만 작업 관리자에서 앱을 제거 할 때 fine.but가 작동합니다. 푸시 알림이 도착하지 않습니다. 내가 알지 못하는 문제가 있습니다. 누구든지 알면 어떻게 해결할 수 있니? 제발 말해줘. 앱에서 작업 관리자를 정리 (제거) 할 때 푸시 알림이 표시되지 않습니까?
이
이있는 내가 통지를 전송하고있는 방법이다 : -private void sendNotification(String msg) {
mNotificationManager = (NotificationManager) this
.getSystemService(Context.NOTIFICATION_SERVICE);
Intent intent = new Intent(this, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP);
Log.e("message.....", msg);
if (msg.equals("You Have got New Message")) {
Log.e("msg occuring..", "intent enter in message...");
intent.putExtra("KEYMESSAGE", "Message");
} else {
Log.e("notification occuring..", "notification occurs.....");
intent.putExtra("KEYNOTIFICATION", "aman");
}
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
mBuilder = (NotificationCompat.Builder) new NotificationCompat.Builder(this)
.setSmallIcon(getNotificationIcon())
.setContentTitle("Telepoh")
.setStyle(new NotificationCompat.BigTextStyle().bigText(msg))
.setContentText(msg)
.setDefaults(Notification.DEFAULT_SOUND | Notification.DEFAULT_VIBRATE);
mBuilder.setContentIntent(contentIntent);
mBuilder.getNotification().flags |= Notification.FLAG_AUTO_CANCEL;
mBuilder.getNotification().flags |= Notification.FLAG_ONGOING_EVENT;
mBuilder.setOngoing(false);
mBuilder.setAutoCancel(true);
mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());
}
내 문제는 알림이 제대로오고있을 때 실행 state.but에서 응용 프로그램 때 작업에서 응용 프로그램 제거 (청소) 매니저에게 통보가 도착하지 않습니다. 누구든지 문제가 무엇인지 안다면 제발 말해줘.
[응용 프로그램이 다중 작업 표시 줄에서 정지 할 때 안드로이드 응용 프로그램은 중포 기지 알림이 수신되지 않는 경우]의 사용 가능한 복제 (http://stackoverflow.com/questions/39504805/android -app-not-receiving-firebase-notification-when-multi-t-stopped- –
방송을 통해 메시지를 받고 있습니까 –
@MujammilAhamed 예! 하지만 때 실행 상태 또는 백그라운드 state.but에서 애플 리케이션은 다음 작업 관리자에서 알림을 도착하지 않는 응용 프로그램을 청소. – aarav