Skip to content
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

Nothing happened when job is finished #72

Open
rafalkowalewski opened this issue Jun 9, 2019 · 6 comments
Open

Nothing happened when job is finished #72

rafalkowalewski opened this issue Jun 9, 2019 · 6 comments

Comments

@rafalkowalewski
Copy link

When I run my taskts and look for any console response, I see only this:

06-09 23:27:06.986 25351 25351 D BackgroundTask: Committing job schedule
06-09 23:34:37.407 25351 26893 D BackgroundTask: Job is running

and nothing happened.
AsyncStorage is empty, console log were not triggered...

Any idea?

Android 9,
`"dependencies": {
"haversine": "^1.1.1",
"lottie-react-native": "^2.6.1",
"native-base": "^2.12.1",
"react": "16.8.3",
"react-native": "0.59.8",
"react-native-background-task": "^0.2.1",
"react-native-camera": "^2.9.0",
"react-native-gesture-handler": "^1.2.1",
"react-native-maps": "^0.24.2",
"react-native-push-notification": "3.1.1",
"react-native-queue": "^1.2.1",
"react-navigation": "^3.11.0",
"react-redux": "^7.0.3",
"redux": "^4.0.1",
"redux-persist": "^5.10.0",
"redux-thunk": "^2.3.0"
},

@rafalkowalewski rafalkowalewski changed the title Nothing happened after job run Nothing happened when job is finished Jun 9, 2019
@alexCarb
Copy link

the same

@rafalkowalewski
Copy link
Author

rafalkowalewski commented Jun 23, 2019

I added this permission and it started working :)
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

@rayjadore
Copy link

rayjadore commented Jul 8, 2019

didnt work for me even after adding the permission, so the thing is that the define() method is never triggered.

@qlerebours
Copy link

For those facing this issue, there is a PR that fixed this for Android 8.0+
#64

@mathiasmoeller
Copy link

The fix in #64 did not solve the issue for me. I am still seeing this behavior.

03-06 13:58:27.010 27548 27641 D BackgroundTask: Initializing
03-06 13:58:27.017 27548 27548 D BackgroundTask: Setting foreground true
03-06 13:58:29.370 27548 27641 D BackgroundTask: @ReactMethod BackgroundTask.schedule
03-06 13:58:50.199 27548 27548 D BackgroundTask: Setting foreground false
03-06 13:58:50.199 27548 27548 D BackgroundTask: Committing job schedule
03-06 14:06:42.622 30274 30326 D BackgroundTask: Job is running
03-06 14:07:14.506 30515 30585 D BackgroundTask: Job is running
03-06 14:08:26.622 30623 30675 D BackgroundTask: Job is running

I call BackgroundTask.define directly in index.js on root level and BackgroundTask.schedule from inside a Compontent. The job should save a dummy value in AsyncStorage. Which it doesn't. Any ideas or any progress on that?

@Ravi828rk
Copy link

any solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants