react-native-background-task
react-native-background-task copied to clipboard
Not working on Android 8.0+
I'm facing the same issue that's mentioned on this bug report: https://github.com/jamesisaac/react-native-background-task/issues/34
11-13 16:20:49.901 20728 20728 D BackgroundTask: Setting foreground false
11-13 16:20:49.901 20728 20728 D BackgroundTask: Committing job schedule
11-13 16:20:52.160 20728 20728 D ReactNative: ReactInstanceManager.detachViewFromInstance()
11-13 16:29:17.859 22953 22987 D BackgroundTask: Job is running
Then nothing happens - my actual task is never called after this point. Any idea how can I resolve this? Obviously setting targetSdk to 25 is not a valid solution anymore since Google requires us to use 26.
Same to me. I have extensively tested. It does not work on Android 8.0+. No matter what I do, the defined task never gets running.
12-28 11:17:32.010 7497 7497 D ReactNative: ReactInstanceManager.ctor()
12-28 11:17:32.036 7497 7497 D ReactNative: ReactInstanceManager.createReactContextInBackground()
12-28 11:17:32.036 7497 7497 D ReactNative: ReactInstanceManager.recreateReactContextInBackgroundInner()
12-28 11:17:33.241 7497 7497 D ReactNative: ReactInstanceManager.onJSBundleLoadedFromServer()
12-28 11:17:33.242 7497 7497 D ReactNative: ReactInstanceManager.recreateReactContextInBackground()
12-28 11:17:33.243 7497 7497 D ReactNative: ReactInstanceManager.runCreateReactContextOnNewThread()
12-28 11:17:33.254 7497 7530 D ReactNative: ReactInstanceManager.createReactContext()
12-28 11:17:33.557 7497 7530 D ReactNative: Initializing React Xplat Bridge.
12-28 11:17:33.560 7497 7530 D ReactNative: Initializing React Xplat Bridge before initializeBridge
12-28 11:17:33.565 7497 7530 D ReactNative: Initializing React Xplat Bridge after initializeBridge
12-28 11:17:33.566 7497 7530 D ReactNative: CatalystInstanceImpl.runJSBundle()
12-28 11:17:33.566 7497 7534 D ReactNative: ReactInstanceManager.setupReactContext()
12-28 11:17:33.567 7497 7534 D ReactNative: CatalystInstanceImpl.initialize()
12-28 11:17:33.625 7497 7534 D ReactNative: ReactInstanceManager.attachRootViewToInstance()
12-28 11:17:34.027 7497 7533 I ReactNativeJS: Running application "helloWord_native" with appParams: {"rootTag":1}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF
12-28 11:17:57.743 7497 7497 D ReactNative: ReactInstanceManager.detachViewFromInstance()
same error is occurring in my app. plz tell me any solution.
@anshumanburman eventually for android we've switched to https://github.com/vikeri/react-native-background-job
The library react-native-background-job works only on Android at the moment. To fix the bug on Android 8, a PR has been opened: https://github.com/jamesisaac/react-native-background-task/pull/64
For those of you still looking for a solution, it seems (according to their README) that https://github.com/transistorsoft/react-native-background-fetch now supports both Android and iOS with a common API, i.e. exactly like this package does.