비컨으로 테스트하는 동안 (ios 디바이스) 리스너 비컨이 예기치 않은 동작을하는 것을 발견했습니다. locationManager : 비콘이 영역에 들어갔더라도 didEnterRegion 메소드가 호출되지 않습니다. 하지만 locationManager : didRangeBeacons : inRegion :이 올바르게 호출되고 감지 된 비콘이 여기에 표시됩니다.locationManager : didEnterRegion과 didExitRegion이 호출되지 않습니다. iBeacon
- (void)startListening{
self.locationManager = [[CLLocationManager alloc] init];
[self.locationManager setDelegate:self];
NSUUID *myProximityUUID = [[NSUUID alloc]
initWithUUIDString:IDENTIFIER];
_beaconRegion = [[CLBeaconRegion alloc]
initWithProximityUUID:myProximityUUID
identifier:kPFTransmitterIdentifier];
_beaconRegion.notifyEntryStateOnDisplay = YES;
_beaconRegion.notifyOnEntry =YES;
[self.locationManager startMonitoringForRegion:self.beaconRegion];
[self.locationManager requestStateForRegion:self.beaconRegion];
//[self.locationManager startRangingBeaconsInRegion:self.beaconRegion];
}
이 내가 작성한 코드입니다.
앱이 실행되지 않아도 리스너 앱이 특정 지역으로 들어갈 때 로컬 알림을 만들어야합니다.
예 .. 이미 해냈습니다 –
확실한 사실은 '신호가 지역에 들어오는 경우'라고 적었습니다. 일을 분명히하기 위해서 : 신호의 영역에 들어가면, 그 방법이 호출되면서, 다른 방법으로는 호출되지 않습니다. 이 상황을 가정 할 때 나는 맞습니까? – Martijn
iBeacon 모니터링을 수행하기 위해 'UIBackgroundModes'에이 위치 값을 설정할 필요가 없습니다. 이 값은 백그라운드에서 실행중인 탐색 앱이 위치 업데이트를 수신하기위한 것입니다. – tedyyu