googlearchive / firebase-jobdispatcher-android

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

JobParameters.getTriggerReason() is null since 0.8.5 update #209

Closed gdjicasonjakesic closed 4 years ago

gdjicasonjakesic commented 6 years ago

Hi,

we are using jobdispatcher content uri trigger to listen to new photo events on the device. Here is the code used for creating the job:

ArrayList<ObservedUri> observedUris = new ArrayList<>();
observedUris.add(new ObservedUri(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, ObservedUri.Flags.FLAG_NOTIFY_FOR_DESCENDANTS));
observedUris.add(new ObservedUri(Uri.parse("content://" + MediaStore.AUTHORITY + "/"), 0));

Job.Builder jobBuilder = firebaseJobDispatcher.newJobBuilder();
jobBuilder.setService(NewOfflinePhotoService.class)
                .setTag(NewOfflinePhotoService.class.getSimpleName())
                .setReplaceCurrent(true)
                .setTrigger(Trigger.contentUriTrigger(observedUris))
                .setLifetime(Lifetime.FOREVER);

JobParameters.getTriggerReason() provided in onStartJob method is null since we updated to version 0.8.5. In version 0.8.3 JobParameters.getTriggerReason().getTriggeredContentUris() returns a list of URIs that triggered the JobService.

Please advice what to do.

vdung7 commented 6 years ago

Did you found another solution for this issue, for applying v0.8.5? I think the updates from 0.8.3 to 0.8.5 is important. I still use v0.8.3 because of this issue

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.