Estimote SDK-信标在后台肆虐 [英] Estimote SDK - Beacons raging in background
本文介绍了Estimote SDK-信标在后台肆虐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
第一个问题是Estimote SDK或CoreLocation框架更好吗?我有正在查找信标的应用程序,但是现在我必须制作一个可以在应用程序处于后台甚至终止状态时找到信标的应用程序.
First question is better is Estimote SDK or CoreLocation framework? I have app which is finding the beacons but now i must made an app which will find beacons when application is in background or even is terminated.
推荐答案
只要您在AppDelegate中进行设置并接收该类中的回调,在iOS中设置后台检测是非常自动的:
Setting up background detection is pretty automatic in iOS so long as you do it in your AppDelegate and receive callbacks in that class:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
_locationManager = [[CLLocationManager alloc] init];
_locationManager.delegate = self;
CLBeaconRegion *region;
region = [[CLBeaconRegion alloc] initWithProximityUUID:[[NSUUID alloc] initWithUUIDString:@"2F234454-CF6D-4A0F-ADF2-F4911BA9FFA6"] major: 1 minor: 1 identifier: @"region1"];
region.notifyEntryStateOnDisplay = YES;
[_locationManager startMonitoringForRegion:region];
[_locationManager startRangingBeaconsInRegion:region];
return YES;
}
您可以在此处了解更多有关后台检测时间的期望:
You can read more about what you can expect from detection times in the background here:
这篇关于Estimote SDK-信标在后台肆虐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文