3

We are using GcmTaskService for uploading entities created by the user asynchronously to our server.

This is working for couple of thousands of users without any issues, but for at least two users the tasks get scheduled but will never run.

We use this code to schedule the task (scheduling is a custom object holding some parameters required to schedule the task):

// Build the OneOffTask
OneoffTask task = new OneoffTask.Builder()
            .setExecutionWindow(2, 5)
            .setService(MyGcmTaskService.class)
            .setTag(scheduling.getTag())
            .setUpdateCurrent(true)
            .setRequiredNetwork(scheduling.isWiFiRequired() ? OneoffTask.NETWORK_STATE_UNMETERED : OneoffTask.NETWORK_STATE_CONNECTED)
            .setExtras(scheduling.getExtrasBundle())
            .build();

// Schedule it
this.mManager.schedule(task);

We are using com.google.android.gms:play-services-gcm:9.8.0. Thanks!

crysxd
  • 3,177
  • 20
  • 32

1 Answers1

0

Check if the phone has activated Battery Optimization for this application (DOZE). It ignores all app which could be a threat to the battery, like background services.

https://es.verizonwireless.com/support/knowledge-base-202636/

Alan Grosz
  • 1,175
  • 10
  • 15