I should use region monitoring in my iOs app for 6 and 7 version. And if my app was closed then system should open it. It works in iOS 6, but not works in iOS 7. I mean, System does not open my app if app was closed in ios 7.
About closing app, I mean, kill this app from memory.
I use this code:
manager = [CLLocationManager new];
manager.delegate = self;
[manager startUpdatingLocation];
if ([UIDevice isIOS7OrHigher]) {
CLCircularRegion *reg = [[CLCircularRegion alloc] initCircularRegionWithCenter:CLLocationCoordinate2DMake(56.844947, 53.208852) radius:20.f identifier:@"reg14132"];
[manager startMonitoringForRegion:reg];
CLCircularRegion *reg1 = [[CLCircularRegion alloc] initCircularRegionWithCenter:CLLocationCoordinate2DMake( 56.844158,53.20913) radius:20.f identifier:@"reg14131232"];
[manager startMonitoringForRegion:reg1];
} else {
CLRegion *reg = [[CLRegion alloc] initCircularRegionWithCenter:CLLocationCoordinate2DMake(56.844947, 53.208852) radius:20.f identifier:@"reg14132"];
[manager startMonitoringForRegion:reg];
CLRegion *reg1 = [[CLRegion alloc] initCircularRegionWithCenter:CLLocationCoordinate2DMake( 56.844158,53.20913) radius:20.f identifier:@"reg14131232"];
[manager startMonitoringForRegion:reg1];
}
And I use delegate methods for log. Also, I use this code for test
if (launchOptions) {
UILocalNotification *note = [UILocalNotification new];
note.alertBody = [NSString stringWithFormat:@"launchOptions = %@", launchOptions];
[[UIApplication sharedApplication] presentLocalNotificationNow:note];
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…