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

After the screen is locked, the background program stops running?

Open AdelaDella opened this issue 5 years ago • 8 comments

After the screen is locked, the background program stops running?

AdelaDella avatar Mar 06 '20 02:03 AdelaDella

I have the same problem

plastic avatar Mar 06 '20 12:03 plastic

Is it that the plug-in itself has problems? Or is there something wrong with what we quoted?

------------------ 原始邮件 ------------------ 发件人: "Andre Andrade"<[email protected]>; 发送时间: 2020年3月6日(星期五) 晚上8:35 收件人: "ocetnik/react-native-background-timer"<[email protected]>; 抄送: "IT々じ浩Ю"<[email protected]>;"Author"<[email protected]>; 主题: Re: [ocetnik/react-native-background-timer] After the screen is locked, the background program stops running? (#198)

I have the same problem

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

AdelaDella avatar Mar 07 '20 01:03 AdelaDella

the problem is with async call inside callback

byteab avatar Mar 07 '20 15:03 byteab

Have you solved the problem? @EhsanSarshar

AdelaDella avatar Mar 07 '20 23:03 AdelaDella

Any solution here?

teamhide avatar Jun 23 '20 03:06 teamhide

@RNHaoHao there are plenty of solutions. for my case I just need to send geolocation in background that solved with react-native-background-geolocation. you can use react-native-background-action or create your own implementation in native side. or use expo inside your bare react native which is also possible and it's an awesome choice in most cases. expo have good modules for handling background task that now you can use within your react native project easily

byteab avatar Jul 20 '20 05:07 byteab

After the screen is locked, the background program stops running?

Yes, background time works when app is minimized, but doesn't work when screen is lcoked.

theagilecoder avatar Jul 27 '20 09:07 theagilecoder

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