jamesisaac / react-native-background-task

Periodic background tasks for React Native apps, cross-platform (iOS and Android), which run even when the app is closed.
MIT License
1.1k stars 110 forks source link

Not working on Android 8.0 #34

Closed stnmonroe closed 6 years ago

stnmonroe commented 6 years ago

First of all, thanks for sharing this amazing package. I have been running this package successfully on Android 7.0 for months now. Then I tested it on two different Android 8.0 devices (Pixel & Xperia) and the background tasks don't execute. Here's what the logcat looks like:

04-24 20:56:14.959 1470 1470 D BackgroundTask: Setting foreground true 04-24 20:56:17.880 1470 1470 D BackgroundTask: Setting foreground false 04-24 20:56:17.881 1470 1470 D BackgroundTask: Committing job schedule 04-24 20:56:20.001 1470 1470 D ReactNative: ReactInstanceManager.detachViewFromInstance() 04-24 21:04:09.176 2563 2592 D BackgroundTask: Job is running

It does not move on from this point. I've tested it many times for up to several days in length.

stnmonroe commented 6 years ago

Apparently this package is not the issue I'm facing. It looks to be with react-native-push-notifications

ttran94 commented 6 years ago

I'm having the same issue. It's stuck at Job is running and the app is also using Firebase notification

stnmonroe commented 6 years ago

In my research, I found that "Job is running" is okay and means it's functioning properly, and that changing the target sdk from 26 to 25 fixed the situation for me (for react-native-push-notifications). That being said, Android is requiring all apps to target 26 or higher, and I don't know what my next move will be for this problem.

scrimmie commented 5 years ago

Did anyone find out how to move past sdk 26?