Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations{
- NSLog(@"locationManager didUpdateLocations: %@",locations);
- if ([CLLocationManager locationServicesEnabled]){
- NSLog(@"Location Services Enabled");
- if ([CLLocationManager authorizationStatus]==kCLAuthorizationStatusDenied){
- alert = [[UIAlertView alloc] initWithTitle:@"App Permission Denied"
- message:@"To re-enable, please go to Settings and turn on Location Service for this app."
- delegate:nil
- cancelButtonTitle:@"OK"
- otherButtonTitles:nil];
- [alert show];
- }
- }
- else {
- for(int i=0;i<locations.count;i++){
- CLLocation * newLocation = [locations objectAtIndex:i];
- CLLocationCoordinate2D theLocation = newLocation.coordinate;
- CLLocationAccuracy theAccuracy = newLocation.horizontalAccuracy;
- self.myLocation = theLocation;
- self.myLocationAccuracy = theAccuracy;
- }
- if (self.shareModel.afterResume==TRUE) {
- appStatus=@"Killed";
- self.locationTracker = [[LocationTracker alloc]init];
- self.locationTracker.str_latitude=[NSString stringWithFormat:@"%f",self.myLocation.latitude];
- self.locationTracker.str_longitude=[NSString stringWithFormat:@"%f",self.myLocation.longitude];
- self.locationTracker.pushStatus=FALSE;
- [self.locationTracker GetDevice_LocationSettings];
- }
- }
- }
Add Comment
Please, Sign In to add comment