forked from firebase/quickstart-android
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Firebase Job Dispatcher for long running tasks.
- Provides compatiability with Android-O - Show good practice on pre Android-O Change-Id: I75edd3e911b6a599f9bc12435fe17c1e3a83b35a
- Loading branch information
Showing
4 changed files
with
68 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
messaging/app/src/main/java/com/google/firebase/quickstart/fcm/MyJobService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.google.firebase.quickstart.fcm; | ||
|
||
import android.util.Log; | ||
|
||
import com.firebase.jobdispatcher.JobParameters; | ||
import com.firebase.jobdispatcher.JobService; | ||
|
||
public class MyJobService extends JobService { | ||
|
||
private static final String TAG = "MyJobService"; | ||
|
||
@Override | ||
public boolean onStartJob(JobParameters jobParameters) { | ||
Log.d(TAG, "Performing long running task in scheduled job"); | ||
// TODO(developer): add long running task here. | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean onStopJob(JobParameters jobParameters) { | ||
return false; | ||
} | ||
|
||
} |