2014-11-21 38 views
0

第一個問題更好的是Estimote SDK或CoreLocation框架?我有應用程序正在尋找信標,但現在我必須創建一個應用程序,當應用程序在後臺甚至終止時,它將找到信標。Estimote SDK - 在後臺肆虐的信標

+0

記者瞭解到,Estimote SDK只是在CoreLocation之上的一層,所以背景的能力是相同的。 – davidgyoung 2014-11-21 13:41:48

+0

好吧,我會propably使用corelocation和如何使應用程序將在後臺憤怒信標? – Spamizator 2014-11-21 17:03:52

回答

0

設置背景檢測是iOS中很自動,只要你做你的AppDelegate,並在該類接收回調:

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

相關問題