【问题标题】:Estimote SDK - Beacons raging in backgroundEstimote SDK - 信标在后台肆虐
【发布时间】:2014-11-21 12:43:02
【问题描述】:

第一个问题是 Estimote SDK 还是 CoreLocation 框架更好?我有一个正在寻找信标的应用程序,但现在我必须制作一个应用程序,当应用程序处于后台甚至被终止时,它会找到信标。

【问题讨论】:

  • 理解Estimote SDK只是CoreLocation之上的一层,所以后台能力是一样的。
  • 好的,我将适当地使用核心定位以及如何制作将在后台使用信标的应用程序?

标签: swift core-location ibeacon estimote


【解决方案1】:

只要您在 AppDelegate 中进行设置并在该类中接收回调,在 iOS 中设置背景检测是非常自动的:

- (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;
}

您可以在此处阅读更多关于后台检测时间的预期信息:

http://developer.radiusnetworks.com/2013/11/13/ibeacon-monitoring-in-the-background-and-foreground.html

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-05-29
    • 1970-01-01
    • 1970-01-01
    • 2014-07-16
    • 2015-03-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多