2

I Have an application made in React Native, which uses localization in background to take some decisions.

What happens is that Doze is killing it everytime user puts it at his pocket.

  • Can't tell the user to switch something on or off

What should I do so my Application keeps collecting the required information?

Guilherme Ferreira
  • 2,209
  • 21
  • 23
  • *Doze is killing it* - how do you know this. Also what is "localization" doing? – Tim Nov 30 '18 at 15:35
  • And are you using Headless to run task in background ? – zagoa Nov 30 '18 at 15:37
  • 1
    Doze is supposed to kill most background application and processes. To ensure your app is not killed You need to create foreground service that will display notification to the user. This tells him that Your app is running and might be draining battery rapidly. – Pawel Nov 30 '18 at 15:40
  • @Pawel i read an answer to a similar question, which said the same. But doing so in React Native i miss the knowledge – Guilherme Ferreira Nov 30 '18 at 15:52

1 Answers1

0

You might need to FCM to woke up device as on required or you might need to think of using job scheduler or alarams to perform required operations.

Ramesh Yankati
  • 1,197
  • 9
  • 13
  • In my case, the App uses localization and connection with Beacons to inform an api about it so i would require to open the app when user is in some location, or close to an specific beacon – Guilherme Ferreira Nov 30 '18 at 16:08