簡體   English   中英

iBeacon技術(iOS開發)

[英]iBeacon Technology (iOS Development)

我需要iBeacon技術的支持。 在我們的情況下,我希望連續掃描(測距)iBeacons的一項功能(如果我們的應用程序位於前景或背景中)。 我們知道使用CLLocationManager標准更新位置方法是可能的。 但是我們不想使用標准的位置更新(因為我們不想冒電池耗盡的風險)。 是否有其他選項可以在不使用CLLocationManager的情況下開始CLBeaconRegion的連續測距?

我正在使用Estimote信標,並且每當信標進入范圍或超出范圍時,都會有委托方法或Estimate SDK(ESTBeaconManager類)可用“ https://github.com/Estimote/iOS-SDK ”,以下所述委托方法將在內部被調用並幫助我們減少電池消耗。我們可以將接近度檢查放置在didEnterRegion方法中:

- (void)beaconManager:(ESTBeaconManager *)manager didEnterRegion:(ESTBeaconRegion *)region{}
- (void)beaconManager:(ESTBeaconManager *)manager didExitRegion:(ESTBeaconRegion *)region{}
- (void)beaconConnectionDidSucceeded:(ESTBeacon*)beacon{}
- (void)beaconConnectionDidFail:(ESTBeacon*)beacon withError:(NSError*)error{}
- (void)beaconManager:(ESTBeaconManager *)manager  didRangeBeacons:(NSArray *)beacons inRegion:(ESTBeaconRegion *)region{}

在iOS上檢測iBeacon傳輸的唯一方法是使用CoreLocation,而且正確的測距方法確實會嚴重消耗電池電量。

從理論上講,您可以使用CoreBluetooth來檢測其他信標類型,例如AltBeacon(讀取iBeacon廣告的詳細信息已被CoreBluetooth阻止),但是電池使用情況仍然相似。

在后台節省電池的標准方法是使用CoreLocation信標監視API,該API在電池上更容易使用。 然后,當這些監視API檢測到信標時,即使您的應用程序處於后台,您也可以開始測距。

有關延長背景測距時間的更多信息,請參見此處: http : //developer.radiusnetworks.com/2014/11/13/extending-background-ranging-on-ios.html

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM