ocetnik / react-native-background-timer

Emit event periodically (even when app is in the background)
MIT License
1.62k stars 230 forks source link

App getting killed/refreshed on IOS #290

Open Shashank123sprive opened 3 years ago

Shashank123sprive commented 3 years ago

Hi Team,

I have created an app in react native, and whenever my app goes in the background, it is getting killed by the OS very frequently, and due to that the user is loosing track his last visited screen, because the app starts from the splash-screen, therefore to tackle this, I have used the react-native-background-timer to track the background run one console.log as long as the app is in background, unfortunately the log is not showing after some time, and which is causing the app to get killed by the OS.

My target is to keep the app running for longer period of time(at least 2-3 min) whenever the app goes in the background, such that it won't get killed and start from the splash screen, it should open the screen where the user was, when he/she kept the app in the background.

Any suggestions/help on this would be really appreciable.

geovannyPaiz commented 3 years ago

any solution for this bug?

davidsalib commented 3 years ago

Experiencing something similar - following

marf commented 3 years ago

We have something similar in our app. We play music in the background and use react-native-background-timer but randomly after some time app gets suspended.

davidsalib commented 3 years ago

@marf which audio player are you using? Having the same issue with www.momento.fm. App is shutting down in the background after a few mins. I thought it could be because I was using too much RAM in the BG (I thought from Redux-Persist), but doesn't seem like that helped.

marf commented 3 years ago

@davidsalib we are using react-native-video but we hadn't any problems until a few weeks ago. Users reported that if they have no connection or are in AirPlane mode app isn't suspended and that's a very weird issue. We monitored the RAM in the background too but it seems stable.

ramzihere commented 3 years ago

facing a similar issue on android while the app is in the background it works fine for 15 to 20 minutes and then the timer stop while changing the app state from background to foreground app killed (crashes) app starts again.

anasvemmully commented 3 months ago

+1, any idea how to tackle this?