ios - CoreBluetooth to detect accessory proximity (whilst app in background) -


i use corebluetooth detect proximity hardware (emitting ble signals) when app runs in background.

the first step activating ble background mode in capabilities tab. allow app receive ble signals when running in background. now, second step write code detect proximity ble peripheral.

looking @ ios developer bluetooth guide (at page 45/46) found:

cbcentralmanagerscanoptionallowduplicateskey constant scan option when calling scanforperipheralswithservices:options: method. when do, discovery event generated each time central receives advertising packet peripheral. turning off default behavior can useful use cases, such initiating a connection peripheral based on peripheral’s proximity (using peripheral received signal strength indicator (rssi) value). t

  • is correct direction this?
  • in terms of ios device battery usage, approach less efficient using ibeacon?

yes, valid approach use corebluetooth describe. can callback each packet detect in foreground (and in background non-manufacturer advertisements). can read rssi indicator of proximity.

whether want use corebluetooth or use ibeacons corelocation, battery usage similar in foreground ranging cases.

if using corebluetooth, don't want keep getting callbacks every packet indefinitely in background, because drain battery faster. corelocation ibeacon apis limit 10 seconds of ranging in background each wakeup event save battery.

if see app ranging longer periods in background using corebluetooth may want add own logic protect against battery drain.


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -