I have a scenario where i have to listen to the XMPP Connection status even when the app is closed. Now I'm using the Firebase Network Dispatcher because of the GCM Network Manager was deprecated, it works only when the app is in foreground/background. It stops whenever the app is closed. Can anyone have suggestions ? Below is my code snippet.
Driver driver = new GooglePlayDriver(getApplicationContext());
FirebaseJobDispatcher firebaseJobDispatcher = new FirebaseJobDispatcher(driver);
Job constraintReminderJob = firebaseJobDispatcher.newJobBuilder()
.setService(FirebaseService.class)
.setTag("Notify Tag")
.setLifetime(Lifetime.UNTIL_NEXT_BOOT)
.build();
firebaseJobDispatcher.schedule(constraintReminderJob);