Ad
Firebase Job Dispatcher Is Not Calling From Thread.setDefaultUncaughtExceptionHandler
I am creating a Firebase Job Dispatcher for sending Error crash report to the server. My Service is not starting with dispatcher's mustSchedule method. It might be due to I am starting my job, not on any activity. Here is my code...
Code for start Service:
public void scheduleJobForUploadCrashReport(Context context, Bundle serviceBundle) {
Logs.i(TAG, "scheduleJobForUploadCrashReport");
FirebaseJobDispatcher dispatcher = new FirebaseJobDispatcher(new GooglePlayDriver(context));
try {
Job job = createJobForuploadCrashReport(dispatcher, serviceBundle);
dispatcher.mustSchedule(job);
Logs.i(TAG, "dispatcher is scheduled---->");
} catch (FirebaseJobDispatcher.ScheduleFailedException e) {
Logs.e(TAG, "FirebaseJobDispatcher.ScheduleFailedException : " + e.getMessage());
e.printStackTrace();
}
}
Code for create a Job:
public Job createJobForuploadCrashReport(FirebaseJobDispatcher dispatcher, Bundle serviceBundle) {
Logs.i(TAG, "createJobForuploadCrashReport");
Job job = dispatcher.newJobBuilder()
.setLifetime(Lifetime.FOREVER)
.setService(UploadApkCrashReportService.class)
.setTag(mAppName + mModuleName)
.setReplaceCurrent(false)
.setRecurring(false)
.setTrigger(Trigger.executionWindow(0, 30))
.setRetryStrategy(RetryStrategy.DEFAULT_LINEAR)
.setConstraints(Constraint.ON_ANY_NETWORK)
.setExtras(serviceBundle)
.build();
return job;
}
Thanks in advance.
Ad
Answer
I have found the problem on the same day but I was quite busy.i am changing my Simple Service to JobService. The problem is in passing a Bundle to my JobService. My JobService is not able to do so much task as I am creating and sending the crash file to the server. But, Service is not able to handle so much after an application crash. The only difference is Simple Service is able to perform the same task after an application crash.
Ad
source: stackoverflow.com
Related Questions
- → should I choose reactjs+f7 or f7+vue.js?
- → Phonegap Android write to sd card
- → Local reference jquery script in nanohttpd (Android)
- → Click to navigate on mobile devices
- → How to allow api access to android or ios app only(laravel)?
- → Access the Camera and CameraRoll on Android using React Native?
- → React native change listening port
- → What is the default unit of style in React Native?
- → Google play market autocomplete icon
- → Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of `ListView`
- → Using Laravel with Genymotion
- → react native using like web-based ajax function
- → react native pdf View
Ad