I want to post a notification when users enter into a region. However, I am very confused because of same two CLLocationManagerDelegate methods. How should I use the two methods properly?
Some people say "didDetermineState" method is needed to start region observation if the app start in the region.
Thanks,
- (void)locationManager:(CLLocationManager *)manager
didEnterRegion:(CLRegion *)region
{
[self sendNotification:@"didEnterRegion"];
}
- (void)locationManager:(CLLocationManager *)manager
didDetermineState:(CLRegionState)state
forRegion:(CLRegion *)region
{
switch (state) {
case CLRegionStateInside:
[self sendNotification:@"didEnterRegion"];
break;
case CLRegionStateOutside:
break;
case CLRegionStateUnknown:
break;
default:
break;
}
}