This can be done easily and without parsing. Add this code to your application delegate
// START WITH
[self.locationManager startUpdatingLocation];
pragma mark - CLLocationManagerDelegate
/*
* locationManager:didUpdateToLocation:fromLocation:
*
*/
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
if (UIApplication.sharedApplication.applicationState == UIApplicationStateActive)
{
}
else
{
NSLog(@"App is backgrounded. New location is %@", newLocation);
UILocalNotification *notification = [[UILocalNotification alloc] init];
notification.alertBody = @"You are near";
[[UIApplication sharedApplication] presentLocalNotificationNow:notification];
}
}
code>Do not forget to add to your info.plist
Location Register Application Registers
source
share