Rapsssito / react-native-background-actions

React Native background service library for running background tasks forever in Android & iOS.
MIT License
818 stars 117 forks source link

Not working when phone screen is off #157

Closed SurajMohanty02 closed 1 year ago

SurajMohanty02 commented 1 year ago

Hii, This package works fine when screen is on . But if i lock the device means it is not working. Can you please suggest me any solution ?

Navicna commented 1 year ago

Ios, android or both?

SurajMohanty02 commented 1 year ago

I've tested on Android

judaihyun commented 1 year ago

notification is show?
-> android only work. when notification show

may be api v12??(i don't remember) above, you must turn off battery optimization

SurajMohanty02 commented 1 year ago

@judaihyun yes , when screen is on it is showing . For some devices notification is not showing once it goes to sleep mode. Battery optimization was off only.

natemartins commented 1 year ago

I'm experiencing same issues. It works well when device is screen is on but once it turns off, the background will not execute. I'm testing on Android 11

@SurajMohanty02 were you able to resolve this?

Navicna commented 1 year ago

Make sure these steps are configured correctly: image

natemartins commented 1 year ago

Yea. I have these configured correctly but still nothing.

bobo717 commented 1 year ago

the same

hraschan commented 1 year ago

Any solutions so far?

SurajMohanty02 commented 1 year ago

w

Are you using this library for getting location ? If so then use react-native-get-location

theoduong05 commented 1 year ago

The same

tranminhnhat1005 commented 1 year ago

You need to turn off battery Optimization or Power Saving Mode for your app in Setting, if you using android 13, let check the notification, background actions need the notification.