我測試iBeacon顯示的區域,我使用didDetermineState:
方法和CLRegionState
是CLRegionStateUnknown
當我在該區域內,任何人可以告訴我爲什麼?CLRegionState是未知的。當我「米
我的藍牙是在和探測信標時,我不等他們CLBeaconStateUnknown,發送者和接收者都在範圍(1米),這裏是我實現
-(void)locationManager:(CLLocationManager *)manager didDetermineState:(CLRegionState)state forRegion:(CLRegion *)region
{
switch (state) {
case CLRegionStateInside:
currentBeconRegion = (CLBeaconRegion *)region;
[self.locationManager startRangingBeaconsInRegion:currentBeconRegion];
NSLog(@"INSIDE the Region");//not logging
break;
case CLRegionStateOutside:
NSLog(@"OUTSIDE the Region");
break;
case CLRegionStateUnknown:
default:
NSLog(@"Region state UNKNOWN!!!"); //Logging on console
statusLabel.text = @"Region state UNKNOWN!!!";
//[self.locationManager stopRangingBeaconsInRegion:beaconRegion];
[self.locationManager startRangingBeaconsInRegion:beaconRegion];//Suceessfully ranging the beacon
break;
}
}
嗨@jhondoe:你已經克服了這個問題,我得到同樣的問題時,我正在jaalee信標。 。 – sabir