Note that there are some explanatory texts on larger screens.

plurals
  1. POCore Location didEnterRegion didn't work
    text
    copied!<pre><code>- (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region </code></pre> <p>works only if the UIView corresponding to class that implement CLLocationManagerDelegate is active.</p> <p>If I changed the view it wont trigger didEnterRegion. Anyone can help me?</p> <p>My code look like this</p> <pre><code>- (void)enableRegionMonitoring { locationManager = [[CLLocationManager alloc] init]; [locationManager setDelegate:self]; CLLocationCoordinate2D myMonLocation = CLLocationCoordinate2DMake(10.766699790955, 76.650101525879); CLRegion *myRegion = [[CLRegion alloc] initCircularRegionWithCenter:myMonLocation radius:100 identifier:@"MyLoc"]; //NSLog(@"reg=%@",myRegion); // Start monitoring for our CLRegion using best accuracy [locationManager startMonitoringForRegion:myRegion desiredAccuracy:kCLLocationAccuracyBest]; } - (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region { NSLog(@"Entered Region"); NSDate *nowx=[NSDate date]; UILocalNotification *localNotification=[[UILocalNotification alloc]init]; if (!localNotification) return; NSDictionary *data = [NSDictionary dictionaryWithObject:@"qw" forKey:@"mykey"]; [localNotification setUserInfo:data]; [localNotification setFireDate:nowx]; [localNotification setTimeZone:[NSTimeZone defaultTimeZone]]; NSMutableString *message=[[NSMutableString alloc]init]; message = @"Local Not Triggered By didEnterRegion"; [localNotification setAlertBody:[nowx description]]; [localNotification setAlertAction:@"Open App"]; [localNotification setHasAction:YES]; [[UIApplication sharedApplication] scheduleLocalNotification:localNotification]; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload