react-native-background-timer
react-native-background-timer copied to clipboard
description of underlying android system used
Hey @ocetnik I'm trying to get a better understanding of how this package works.
The README mentions that it can fire a timer when the app is in the background.
Looking through the codebase it looks like to me you are scheduling stuff with
import android.os.Handler;
My understanding is that Handlers will only fire when the app is in the background and the phone is on. If the phone screen has been turned off and no app has a WakeLock then I believe the handler will no longer fire.
If this is needed then an AlarmManager is needed... does that sound right to you?
I'm wresting with this same question. I need to do periodic tasks whether or not the app is running.
I was wondering if this module can do that, but it seems not.
I'm looking at AlarmManager. However, I don't see a react-native component that uses that. Also, the docs for AlarmManager say, "Keep your alarm frequency to a minimum." I don't know what that means. Is once every 10 minutes too frequent? Once a minute?
@funkyeah How did you solve this problem ?