Firebase作业调度程序无法在One Plus设备上安排作业

时间:2018-01-09 08:06:37

标签: android background-service android-background firebase-job-dispatcher

我正在使用Firebase Job Dispatcher来安排作业

Driver driver = new GooglePlayDriver(context);
        FirebaseJobDispatcher dispatcher = new FirebaseJobDispatcher(driver);

        Job pedometerReminderJob = dispatcher.newJobBuilder()
                                    .setService(PedometerService.class)
                                    .setTag(PEDOMETER_JOB_TAG)
                                    .setLifetime(Lifetime.FOREVER)
                                    .setRecurring(true)
                                    .setTrigger(Trigger.executionWindow(0,60))
                                    .setReplaceCurrent(true)
                                    .build();

        dispatcher.schedule(pedometerReminderJob);

我已经检查了一些设备,例如nexus 6p,三星galaxy s7,Xiomi设备(我已经请求允许在自动启动时启用该应用程序)。但是,我面临着在One Plus设备上安排它的问题(工作服务开始了一段时间但突然停止了。)

0 个答案:

没有答案