googlearchive / firebase-jobdispatcher-android

DEPRECATED please see the README.md below for details.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Job not running on Oreo 8.1

krishnanvs11 opened this issue · comments

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);

@krishnanvs11 found any solution?

//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.

found any solution ?

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.