Job myJob = dispatcher.newJobBuilder()
// the JobService that will be called
.setService(MyJobService.class)
// uniquely identifies the job
.setTag("my-unique-tag")
// one-off job
.setRecurring(true)
// don't persist past a device reboot
.setLifetime(Lifetime.FOREVER)
// start between 0 and 60 seconds from now
.setTrigger(Trigger.executionWindow(0, 60))
// don't overwrite an existing job with the same tag
.setReplaceCurrent(false)
// retry with exponential backoff
.setRetryStrategy(RetryStrategy.DEFAULT_LINEAR)
// constraints that need to be satisfied for the job to run
// .setConstraints(
// // only run on an unmetered network
// Constraint.ON_UNMETERED_NETWORK,
// // only run when the device is charging
// Constraint.DEVICE_CHARGING
// )
.setExtras(myExtrasBundle)
.build();
dispatcher.mustSchedule(myJob);
我正在尝试使用firebase jobdispatcher来支持我的日历应用程序的旧设备和新设备,我指的是这个链接在我的应用程序中设置firebase代码是否需要在每周等特定时间安排工作或其他任何事情替代方案?在触发窗口设置方面需要帮助以递归地在特定时间和日期安排事件。例如,为期 1 周的每日下午 4 点活动