Listening iBeacons even if the app is closed

2019-09-17 03:45发布

问题:

I was wondering if it is possible to listen ibeacons even if the app that have the implementation (code to interact over BLE - ibeacons) is closed.

Is it possible? Can i write a code that 'tells' to the device to listen ibeacons all the time and if found any, need to do some action based on code from specific app? Or i need that my app still running all the time to listen the ibeacons?

Thank in advance.

回答1:

Yes, the Android Beacon Library is designed to do exactly this. It automatically launches a background beacon scanner service on various system events, and can then start your app's Activities based on beacon detections.

See here for details: http://altbeacon.github.io/android-beacon-library/background_launching.html