jbeuckm / TiBeacons

iBeacon advertising and scanning in a Titanium module
Other
135 stars 57 forks source link

startAdvertisingBeacon vs stopRangingForBeacons vs startMonitoringForRegion documentation #14

Closed R1Daneel closed 10 years ago

R1Daneel commented 10 years ago

I'm testing an application built using your module (thanks for this) but I did not understand the difference between the three methods startAdvertisingBeacon, stopRangingForBeacons and startMonitoringForRegion. Is possible to have a brief documentation?

jbeuckm commented 10 years ago

I will try to improve the readme. For the time being, have you reviewed the apple docs?

https://developer.apple.com/library/ios/documentation/corelocation/reference/CLLocationManager_Class/CLLocationManager/CLLocationManager.html#//apple_ref/doc/uid/TP40007125-CH3-SW19

As I understand, "monitoring" is the lowest-energy activity that will let you know if you enter or exit your regions. "Ranging" takes a little more energy and is done to find beacon proximity while the beacon is in range. I typically "monitor" all the time (background, foreground) until a region is found, then "range" for a little while when I want to perform some action due to specific proximity of a beacon -- far, near or immediate.

R1Daneel commented 10 years ago

As I understand from reading various articles "monitoring" is used only to detect entering in a region and exiting from it. But it doesn't run in the background continuously, every few seconds the apple device start the monitoring for some seconds and the turn off agin the monitoring to save energy. The "Ranging" is the same as you've explained. I still have not understood for what is used startAdvertisingBeacon method.

jbeuckm commented 10 years ago

startAdvertisingBeacon() allows your app to impersonate an iBeacon. This can only be done while the app is in the foreground. If you have two devices, try advertising with one device and monitoring the same region on the other device. Useful for testing...

R1Daneel commented 10 years ago

Now it is clear, thanks for the help.