我已經創建了一個用於信標的iphone應用程序。在那我想顯示消息,當我退出所有的信標區域。如何在didExitRegion中獲取燈塔主要和次要ID
我不想顯示每個信標出口區域的消息。例如,如果有3個信標,則只有當我退出所有3個信標時才顯示該信息。有可能這樣做嗎?
,也是我想在
didExitRegion
我用下面的代碼退出的信主要和次要值:
-(void)locationManager:(CLLocationManager*)manager
didRangeBeacons:(NSArray*)beacons
inRegion:(CLBeaconRegion*)region
{
// Beacon found!
NSLog(@"iBeacons found");
// UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Successfully found" message:nil delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles: nil]; [alert show];
CLBeacon *foundBeacon = [beacons firstObject];
// You can retrieve the beacon data from its properties
NSString *uuid = foundBeacon.proximityUUID.UUIDString;
NSString *majorId = [NSString stringWithFormat:@"%@", foundBeacon.major];
NSString *minorId = [NSString stringWithFormat:@"%@", foundBeacon.minor];
NSLog(@"UUID: %@", uuid);
}
在上面的代碼中我能得到的uuid,主要的,次要的信標。但是我想要獲取didExitRegion
中現有信標的值。可能嗎?
在此先感謝。
我試過你的解決方案,我得到的UID,但主要和次要值爲null。任何幫助將是偉大的:) –