Obtaining Major/Minor values 'without' monitoring?

时间:2015-09-01 21:57:00

标签: ios uuid ibeacon

I am aware that monitoring is used to notify an application when it enters a specific region. The goal is to simply set up a backend that adds +1 to a count-value that represents the amount of times a smart device entered a region. But I don't think I understood the way monitoring works yet.

If I were to set that only a certain UUID value shall be monitored, the application will be notified at any region of any iBeacon with the same UUID it enters. Is there any way to also obtain Major and Minor values of the regions withouth specifically asking for them / setting them up? It should be possible as the data payload also contains the Major and Minor values anyways?! Or would I need to specify any created beacon with their respective UUID, Major and Minor to be monitored in order to track and increase a count-value?

Let me reprhase: Is it possible to obtain UUID, Major and Minor value when entering any region without having to set up CLLocationManager or monitoring in generall (for Major and Minor) as the payload contains that information? Reading through similar topics on here suggested that in this case ranging comes into play. This got me more confused as I thought ranging only uses the measured power within the data payload to determine the aproximate distance?

1 个答案:

答案 0 :(得分:1)

  

输入任何内容时是否可以获得UUID,Major和Minor值   区域,无需设置CLLocationManager或监视   generall(对于Major和Minor),因为有效负载包含它   信息?

没有。将使用locationManager:didEnterRegion:对象调用CLRegion,该对象将是包含UUID,主要和次要数字的CLBeaconRegion,但对应于标识符例如,导致进入事件的特定信标,仅仅是您已经提供的区域。 (更具体地说,例如,如果您仅基于UUID开始监控,则会CLBeaconRegion majorminor设置为nil,而不会填充<div id="testDiv"><p>This is demo page</p></div> 通过导致事件的信标的值。)

您的推理没有任何问题 - 设备确实拥有您感兴趣的信息 - iOS只是没有在应用程序级别提供。

  

通过这里的类似主题阅读建议在这种情况下   范围发挥作用。

是的,您可以在区域输入(或之前)开始测距,此时您将拥有该区域中可见信标的完整标识符列表。 a good answer covering this中有a different question