I am using FCM push notification for start service in background mode but the app will not be getting any notification after killing the app. and I'm facing this problem in only vivo device. In other devices, it is working fine.
when i manually enable auto start then it will working fine. but without enable auto starts it will not working.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
Intent intent = new Intent(ACTION_MAIN);
intent.setClass(this, LinphoneService.class);
intent.putExtra("PushNotification", true);
startForegroundService(intent);
} else {
Intent intent = new Intent(ACTION_MAIN);
intent.setClass(this, LinphoneService.class);
intent.putExtra("PushNotification", true);
startService(intent);
}
I need to start my service whenever app gets firebase push notification in all devices without enabling auto-start.