Does Firebase Service Manager need Internet access to schedule work?

Does Firebase Work Manager need to access the Internet to schedule work? When I turn off my Internet access, it looks like the planned work does nothing at all. When I bring it back, the scheduled task will start working.

This is my code for scheduling work using the Firebase Job.

FirebaseJobDispatcher dispatcher = 
                    new FirebaseJobDispatcher(new GooglePlayDriver(this));
Job myJob = dispatcher.newJobBuilder()
   .setService(MyJobService.class)
   .setRecurring(true)
   .setTrigger(Trigger.executionWindow(2, 10))
   .setRetryStrategy(RetryStrategy.DEFAULT_LINEAR)
   .setTag("location-update-job")
   .setLifetime(Lifetime.FOREVER)
   .setConstraints(Constraint.ON_ANY_NETWORK)
   .setRecurring(true)
   .build();

dispatcher.mustSchedule(myJob);
+4
source share
1 answer

when you use .setConstraints(Constraint.ON_ANY_NETWORK), the task will be executed, if there is any type of network connection, you can choose between a nickname, any and without interference (Wifi), by default it is NONE, so just deletesetConstraints

+3

Source: https://habr.com/ru/post/1676221/


All Articles