9

I have a task to perform which requires internet and has to be performed everyday indefinitely, below is the code I had written to perform the same

FirebaseJobDispatcher dispatcher = new FirebaseJobDispatcher(new GooglePlayDriver(this));
        Job myJob = dispatcher.newJobBuilder()
                .setService(FirebaseJobDispatcherService.class) // the JobService that will be called
                .setTag(Constants.ALERT_TAG)        // uniquely identifies the job
                .setRecurring(true)
                .setLifetime(Lifetime.FOREVER)
                .setReplaceCurrent(true)
                .setRetryStrategy(RetryStrategy.DEFAULT_LINEAR)
                .setTrigger(Trigger.executionWindow(0, (int) TimeUnit.DAYS.toSeconds(1)))
                .setConstraints(Constraint.ON_ANY_NETWORK)
                .build();

        dispatcher.mustSchedule(myJob);

Now the issue is, it works properly on normal devices like Moto, Samsung etc but on Custom ROMs like OnePlus, Xiaomi the job triggers only when the app is opened. Has anyone faced this issue or know how to make it work properly on Custom ROMs as well?

Rob
  • 2,243
  • 4
  • 29
  • 40
sanket vetkoli
  • 826
  • 14
  • 18
  • Faceing same issue. Any resolution? – Sanidhya Kumar Dec 04 '17 at 15:37
  • 1
    I had raised an issue on their github page, they told me to contact the device manufacturers, one guy replied though with a solution to make it work on MIUI device, I haven't tried it yet but you can check that out. Here's the link https://github.com/firebase/firebase-jobdispatcher-android/issues/169 – sanket vetkoli Dec 05 '17 at 08:57

0 Answers0