1

Can we call the location service alert to pop up again by not closing the app and go to setting page.Like some user dont know whether they have to select 'allow or not allow' once it get popup.Any solution of the issue.

  • What exactly are you asking? If you're trying to route the user to the settings page to modify his location access, you can no longer do that. See this question: http://stackoverflow.com/questions/9627451/how-to-open-preferences-settings-with-ios-5-1 – johngraham Sep 13 '12 at 04:40

2 Answers2

4

If your requirment is to remind the user about his location service status, you can provide your own alert about it, and can navigate user to Settings page.

      - (void) showLocationAlert {

                if ([CLLocationManager authorizationStatus] != kCLAuthorizationStatusAuthorized) {

                        //Check whether Settings page is openable (iOS 5.1 not allows Settings page to be opened via openURL:)
                        if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"prefs:root=LOCATION_SERVICES"]]) {
                            UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Error" message:@"You must enable location service,Turn on location service to allow \"YourApp\" to determine your location" delegate:self cancelButtonTitle:@"Settings" otherButtonTitles:@"Cancel", nil];
                            [alert show];

                        }
                        else {
                            UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Error" message:@"You must enable location service" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil];
                            [alert show];
                        }
                 }
            }



  - (void) alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex  {
          if (buttonIndex == 0) {
                [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=LOCATION_SERVICES"]];
            }

        }
Ab'initio
  • 5,368
  • 4
  • 28
  • 40
0

Unfortunately, it is not possible to do so unless the device is Jailbroken. However, it is relatively simple to route the user to the correct area in the settings pane.

Darth Maul
  • 84
  • 8