react-native-background-timer icon indicating copy to clipboard operation
react-native-background-timer copied to clipboard

react-native-background-timer package stops working in background in android

Open sajjad-yousaf opened this issue 4 years ago • 20 comments

I am trying to build the app in react native which plays sound in every 8 sec now when I install the app in debug mode locally sound plays in every 8 sec even mobile is locked or app in the background,

now when I make an android apk and install on my device and start the app in the background then after roundabout 40-sec app stops working until I awake my app.

Please help me to solve this problem.

sajjad-yousaf avatar Jul 02 '20 05:07 sajjad-yousaf

I'm experiencing same issue ^^

andrzej-wower-aipa avatar Jul 02 '20 09:07 andrzej-wower-aipa

I'm also facing the same issue with Android. Any quick fix available?

midrispak avatar Jul 06 '20 19:07 midrispak

don't think there is a quick fix or even long one, even wit adding an audio that was plaing in the background to keep app somewhat alive interval was misbehaving and unpredictable.


From: midrispak [email protected] Sent: 06 July 2020 20:01 To: ocetnik/react-native-background-timer [email protected] Cc: Wower, Andrzej [email protected]; Comment [email protected] Subject: [External] Re: [ocetnik/react-native-background-timer] react-native-background-timer package stops working in background in android (#237)

This message is from an EXTERNAL SENDER - be CAUTIOUS, particularly with links and attachments.


I'm also facing the same issue with Android. Any quick fix available?

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_ocetnik_react-2Dnative-2Dbackground-2Dtimer_issues_237-23issuecomment-2D654411547&d=DwMCaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=O2RIchPmjfvkjvq7nr3n0yF96OLFAizbI9KGKcFBhIg&m=7Jy5eq4tfpIc4YgW6yIC_jlGXBIEqZwPAefJQJRqkac&s=amDP3vsLI9ClcfCLYZOAbU6MQ-vfENO76HNu18msh4A&e=, or unsubscribehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AMGUMTUG7CLJEANIXPODS7TR2INRHANCNFSM4OOQOBNA&d=DwMCaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=O2RIchPmjfvkjvq7nr3n0yF96OLFAizbI9KGKcFBhIg&m=7Jy5eq4tfpIc4YgW6yIC_jlGXBIEqZwPAefJQJRqkac&s=_aYKcQlysoWOrM5n_QvJvb_haO1dSkqRIMhw-pGd8fs&e=.


This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy. Your privacy is important to us. Accenture uses your personal data only in compliance with data protection laws. For further information on how Accenture processes your personal data, please see our privacy statement at https://www.accenture.com/us-en/privacy-policy.


www.accenture.com

andrzej-wower-aipa avatar Jul 07 '20 08:07 andrzej-wower-aipa

Hello guys, I have the same issue when i generate an apk, any update on this?

MuriloDutra avatar Jul 15 '20 18:07 MuriloDutra

Same issue. Works well if screen is unlocked and app is minimized. But when the screen is locked and off, BackgroundTimer.setInterval and BackgroundTimer.setTimeout stop working until the app is awakened. This is an Android OS thing, so nothing can be done except for adding native code.

theagilecoder avatar Jul 27 '20 09:07 theagilecoder

same here

coolirisroto avatar Aug 12 '20 20:08 coolirisroto

same here

yangga avatar Aug 20 '20 01:08 yangga

Same here. If the application is on background or screen is locked. It is not running the code snippet I setup.

enesozturk avatar Aug 26 '20 13:08 enesozturk

Same here

ostaptsizh-mbrx avatar Sep 28 '20 09:09 ostaptsizh-mbrx

Same here

alfonsograziano avatar Oct 04 '20 15:10 alfonsograziano

Same here

tbassani avatar Oct 05 '20 03:10 tbassani

same here. Is any fix available?

Thilanka-97 avatar Jan 13 '21 07:01 Thilanka-97

same here :(( OMG

brilly4n avatar Jan 29 '21 07:01 brilly4n

Also the same issue. Although I noticed that when the phone is charging the background timer works just fine

laimis-dev avatar Mar 02 '21 21:03 laimis-dev

Same for me unable to stop in the background if you have multiple instalnce.

pratius avatar Mar 30 '21 10:03 pratius

Hi, I had this same issue and found no easy solution with this library, so I made my own which works even if the device is locked (among other improvements). Only Android is supported, but you can still use this (or another) library for iOS in conjunction.

https://www.npmjs.com/package/react-native-background-timer-android

I've been using it in my production apps for more than a week with no issues.

juanamd avatar May 27 '21 18:05 juanamd

Hi, I had this same issue and found no easy solution with this library, so I made my own which works even if the device is locked (among other improvements). Only Android is supported, but you can still use this (or another) library for iOS in conjunction.

https://www.npmjs.com/package/react-native-background-timer-android

I've been using it in my production apps for more than a week with no issues.

great work buddy!

margrudniak avatar Jun 02 '21 18:06 margrudniak

Same here. Any solution to this?

ramzihere avatar Jun 29 '21 06:06 ramzihere

Hi, I had this same issue and found no easy solution with this library, so I made my own which works even if the device is locked (among other improvements). Only Android is supported, but you can still use this (or another) library for iOS in conjunction.

https://www.npmjs.com/package/react-native-background-timer-android

I've been using it in my production apps for more than a week with no issues.

Tried this as well but facing the same issue

ramzihere avatar Jun 29 '21 07:06 ramzihere

same

shinnachot avatar Aug 03 '21 09:08 shinnachot