iBeacon background processing

Ask, and ye shall receive.
User avatar
micke
Posts: 256
Joined: 20:49, 18 Nov 2013

iBeacon background processing

Postby micke » 16:48, 17 Jun 2014

Hello everyone!

Doing some research on how iBeacons work when running an app in the background on Android and iOS, and would like to share some findings and open up for sharing experiences.

The Cordova plugins I am currently looking at are:

https://github.com/evothings/cordova-ibeacon (Android)
https://github.com/petermetz/cordova-plugin-ibeacon (iOS)

Android should be easy, just perform iBeacon scanning in the background using the above plugin.

iOS is more intricate.

Reports indicate that you should be able to monitor iBeacons in the background just by setting the notifyEntryStateOnDisplay flag. See e.g. this post:

http://developer.radiusnetworks.com/201 ... round.html

The notifyEntryStateOnDisplay flag is set to true by default in the cordova-plugin-ibeacon plugin, see this file:

https://github.com/petermetz/cordova-pl ... ibeacon.js

Then again, the following thread reports that the flag is not significant when it comes to background monitoring:

http://stackoverflow.com/questions/1914 ... 4#19152814

This post reports that it is important to have the CLLocation delegate code in AppDelegate.m:

http://stackoverflow.com/questions/1912 ... 3#22515773

And this thread emphasizes that you need to use both ranging and monitoring at the same time:

http://stackoverflow.com/questions/2045 ... monitoring

Apple's documentation makes some mention about background monitoring:

https://developer.apple.com/library/ios ... oring.html

Here we can read that you should make a setting in Xcode, on the "Capabilities" tab, under "Background Modes", where you can enable "Location Updates" (and in case of working with BLE directly "Uses Bluetooth LE Accessories").

https://developer.apple.com/library/ios ... sFlow.html

Again, the above blogpost by RadiusNetworks reports that setting the location background mode makes no difference.

To sum up, I am pretty confused. The only way to get real proof of what works when it comes to iBeacons and background processing seems to be to go ahead and experiment.

I am also confused by the difference between "monitoring" and "ranging".

Any advice anyone?

Regards, Mikael

User avatar
micke
Posts: 256
Joined: 20:49, 18 Nov 2013

Re: iBeacon background processing

Postby micke » 17:10, 17 Jun 2014


User avatar
micke
Posts: 256
Joined: 20:49, 18 Nov 2013

Re: iBeacon background processing

Postby micke » 23:40, 27 Nov 2014

Just an update, here is a guide for how to use notifications when ranging Estimote beacons when the app is in the background:

https://github.com/evothings/phonegap-e ... tion-guide

This should work also with the plugin: cordova-plugin-ibeacon

Regards, Mikael


Return to “Questions and answers”

Who is online

Users browsing this forum: No registered users and 59 guests