eddieowens / react-native-boundary

Native implementation of geofencing/region monitoring

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Will a boundary live forever if I don't remove it?

AkshitSahani opened this issue · comments

Hi Eddie, first of all thanks for your work on this library. It is much appreciated!

I wanted to first ask how much resources this library uses to set up a geofence boundary? My application needs to set geofences for each location of a user's 'workorders'. Currently it is set up to fetch the workorders and create the geofences every time the user logs in. This I know will cause redundancy. So I wanted to get an idea as to:

  • How taxing it is on the phone and the application to set geofences?

  • What happens if I keep recreating the same boundary over and over again, without removing a previous instance? Will it overwrite the previous one? Or will there end up being multiple geofences around the same location meaning the on ENTER and on EXIT functions will be called multiple times when a user crosses the boundary?

  • Also, what happens if I do not remove a boundary? Does it live forever?

Thanks again. I know these are not actually bugs but there was no other way for me to ask you these questions.

  1. The library is wrapping the respective native geofencing library. The geofences are triggered when a user enters the radius of a lat lng, so it is not demanding on battery or data.
  2. If you make multiple calls to the add function, a new ID will be returned and a new boundary will be created. I'd assume that the underlying OS would create completely new geofences but I haven't tested this case exactly.
  3. It depends on the OS. I know for Android if you don't remove a boundary it will live on the device until it is rebooted, the app is uninstalled, or the data is cleared.

Also, it sounds like this may be relevant to your use case; Android allows 100 geofences maximum, and iOS allows for 20 geofences maximum. You may want to implement some logic to handle more than the limit.

Thanks!

@eddieowens Thank you so much for the response. I really appreciate it!