Bluetooth Low Energy Android - Background Search

I would like to know if it is possible to check the background if someone enters or leaves the lighthouse region?

In iOS, for example, you can use methods didEnterRegionor didExitRegionto send notifications from the background.

Is there any native opportunity or does anyone have a workaround?

+2
source share
1 answer

Android doesn't have iBeacon native features at all, but you can see iBeacons using my open source iBeacon Library for Android , which has APIs similar to those native to iOS 7.

In the case of iOS, it CLLocationManagerDelegategives you access to didEnterRegion didExitRegion didEnterRegionand didExitRegionwhich you describe. In Android, the iBeacon Library equivalent is an interface MonitorNotifierthat gives you the same callback methods.

Successfully completing these callbacks for apps that aren't in the foreground is a bit tricky for iOS and Android. On Android, you need to start your own service, which starts when the Android device starts up and binds to IBeaconManager in this service.

, iBeacon Library Pro Android, . .

EDIT: Android Beacon , -, .

+1

Source: https://habr.com/ru/post/1541731/


All Articles