-2

My android app needs to find a beacon in background. To do so I'm using the google nearby messaging api with beaconId.

To have a scan in foreground I'm subscribing the messages client in a foreground service, but my app after some times stops seeing the beacon.

Am I missing something?

imtoori
  • 570
  • 6
  • 13

1 Answers1

0

Your app is subscribing to receive events, but nearby won't scan unless there is an on screen event. So likely you are putting your phone to a lock screen (I'm assuming) and nearby won't scan again until you unlock your phone.

I would recommend reading the documentation further. It sounds like this might not be the right library you are looking for if you are having issues like this.

https://developers.google.com/nearby/

Randy
  • 1,400
  • 2
  • 12
  • 30