Skip to content

Nothing happened when job is finished #72

Open
@rafalkowalewski

Description

@rafalkowalewski

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"
},

Activity

changed the title [-]Nothing happened after job run[/-] [+]Nothing happened when job is finished[/+] on Jun 9, 2019
alexCarb

alexCarb commented on Jun 20, 2019

@alexCarb

the same

rafalkowalewski

rafalkowalewski commented on Jun 23, 2019

@rafalkowalewski
Author

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

rayjadore

rayjadore commented on Jul 8, 2019

@rayjadore

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

qlerebours

qlerebours commented on Aug 30, 2019

@qlerebours

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

mathiasmoeller

mathiasmoeller commented on Mar 6, 2020

@mathiasmoeller

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

Ravi828rk commented on Jul 26, 2022

@Ravi828rk

any solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @mathiasmoeller@qlerebours@rafalkowalewski@Ravi828rk@alexCarb

        Issue actions

          Nothing happened when job is finished · Issue #72 · jamesisaac/react-native-background-task