-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why Task Stop Working When App Terminate In Android #451
Comments
Where’s your Debug Logs from $ adb logcat? |
@christocracy i updated please check again i see there is a error "05-27 22:14:11.802 211 215 E android.system.suspend@1.0-service: Error opening kernel wakelock stats for: wakeup0: Permission denied" |
None of that references anything from the plug-in. See https://dontkillmyapp.com |
@christocracy How to debug it? will it cause this problem in production ? |
I have no idea what those logs mean. I suggest you modify device settings according to https://dontkillmyapp.com. |
@christocracy Also after running the app for 10min it gave this warning " WARN No task registered for key BackgroundFetch" any idea about can be the issue? is it common? |
I suggest you simplify your code. Comment-out all your “uploading” stuff and simply do a log statement. them simulate tasks according to the Debugging section in README |
@christocracy i tried remove all the upload stuff and just hit a api after 3 seconds it does any hit the api |
Your api calls don’t concern me. I’m only interested in seeing your callback function print a message to the logs. |
@christocracy it found this error for just console.log("Hello World") in background "05-28 15:32:40.212 3098 7224 E BgTaskExecutorImpl: EXCLUSIVE background task FETCH_CONFIGS_FROM_PHENOTYPE was cancelled. Can i give a github repo of the project? |
Comment-out your entire BackgroundFetch.configure({
minimumFetchInterval: 15,
stopOnTerminate: false,
startOnBoot: true,
enableHeadless: true,
requiredNetworkType: BackgroundFetch.NETWORK_TYPE_ANY
}, async (taskId:string) => {
console.log('[BackgroundFetch] taskId', taskId);
BackgroundFetch.finish(taskId);
}, (taskId:string) => {
console.log('[Fetch] TIMEOUT taskId:', taskId);
BackgroundFetch.finish(taskId);
}); While simulating events according to the README, observe and provide the $ adb logcat *:S ReactNative:V ReactNativeJS:V TSBackgroundFetch:V |
@christocracy i cant see any message related to "Register Task" however i found out a log that says
|
What exactly are you executing to simulate the task? |
@christocracy I am just uploading image to cloud for test purpose I am logging hello world in background |
I’m not talking about your “upload” code. what is the |
@christocracy Chris it logs this:
|
Are you not aware you can SIMULATE fetch events? read the README to learn how to simulate events. |
@christocracy yep it logs this "Running job [FORCED]" |
Print the logs after simulating an event. |
@christocracy Can you please tell me what if mean about "Print the logs after simulating an event" i run this "adb shell cmd jobscheduler run -f <your.application.id> 999" |
“Print the logs” = |
@christocracy When i run
|
Are you replacing |
@christocracy maybe i am doing wrong is this correct?
|
@christocracy Can you give me a simple rn component code snippet that i can copy test and check for any problem with my Android emulator? |
That’s exactly what I posted above. |
@christocracy I already tried that code can you tell what is a positive log that I can see on console to assure that things are correct |
|
This issue is stale because it has been open for 30 days with no activity. |
This issue was closed because it has been inactive for 14 days since being marked as stale. |
Your Environment
Expected Behavior
It should upload the file to the cloud when i Terminate the app on Android when i call the uploadHandler function and. the data.message from the API is "successfully" it should call the ImageHandler function and run it in the background
Actual Behavior
It's not uploading files to the cloud and not hitting the API tried this thing many times and also check my server logs
Steps to Reproduce
Context
Debug logs
The text was updated successfully, but these errors were encountered: