googlearchive / firebase-jobdispatcher-android

DEPRECATED please see the README.md below for details.
Apache License 2.0
1.79k stars 208 forks source link

Job not running on Oreo 8.1 #266

Closed krishnanvs11 closed 4 years ago

krishnanvs11 commented 6 years ago

On a Nokia1 TA-1066 model, Android v 8.1.0, the scheduler is not running periodically. I tried adding a test scheduler in Boot up but it is not running. This is the code snippet, appreciate your quick help.

    <service
        android:name=".TestFBDispJobService"
        android:enabled="true">
        <intent-filter>
            <action android:name="com.firebase.jobdispatcher.ACTION_EXECUTE"/>
        </intent-filter>
    </service>

        FirebaseJobDispatcher test1 = new FirebaseJobDispatcher(new GooglePlayDriver(context));
        Job job = test1.newJobBuilder()
                //persist the task across boots
                .setLifetime(Lifetime.FOREVER)
                //call this service when the criteria are met.
                .setService(TestFBDispJobService.class)
                //unique id of the task
                .setTag("TEST1")
                //don't overwrite an existing job with the same tag
                .setReplaceCurrent(true)
                // We are mentioning that the job is periodic.
                .setRecurring(true)
                .setTrigger(Trigger.executionWindow( (60 * 15),
                        ((60 * 20) + (60 * 5)))
                // retry with exponential backoff
                .setRetryStrategy(RetryStrategy.DEFAULT_LINEAR)
                //.setRetryStrategy(RetryStrategy.DEFAULT_EXPONENTIAL)
                //Run this job only when the network is available.
                .setConstraints(Constraint.ON_ANY_NETWORK)
                .build();
        test1.mustSchedule(job);
imvikasrai commented 5 years ago

@krishnanvs11 found any solution?

temirlannurdinov commented 5 years ago
//Run this job only when the network is available.
                .setConstraints(Constraint.ON_ANY_NETWORK)
// We are mentioning that the job is periodic.
                .setRecurring(true)
                .setTrigger(Trigger.executionWindow( (60 * 15),
                        ((60 * 20) + (60 * 5)))

As I know you can set only one of these. Or periodic or network trigger.

lyw-94 commented 5 years ago

found any solution ?

samtstern commented 4 years ago

In April 2019 we announced that Firebase Job Dispatcher would be deprecated today, April 7th 2020. For this reason we are going to close all open issues and archive the repository. We will also stop supporting FJD for new app installations (such as those targeting sdk versions greater than Android Q). Existing apps that rely on FJD should continue to function as usual.

While we will no longer work on FJD, we encourage you to migrate to Work Manager which is a superior tool and fully supported by the Android team.

Thank you for taking the time to try the library and provide this feedback. We sincerely appreciate your effort and we apologize for not addressing it in time.