Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7410511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:14:41+00:00 2026-05-29T06:14:41+00:00

The CLLocationManager prompts an alert App name Would you like to use your location

  • 0

The CLLocationManager prompts an alert

“App name” Would you like to use your location

which offers two buttons, OK and Don’t allow. How to know which of the buttons has the user selected?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T06:14:41+00:00Added an answer on May 29, 2026 at 6:14 am

    When you click on Don’t allow button

    - (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
    will be called with kCLAuthorizationStatusDenied exception. You can write your inside it.

    Also refer :

    kCLAuthorizationStatusNotDetermined = 0, // User has not yet made a choice with regards to this application
    kCLAuthorizationStatusRestricted,        // This application is not authorized to use location services.  Due
                                                 // to active restrictions on location services, the user cannot change
                                                 // this status, and may not have personally denied authorization
    kCLAuthorizationStatusDenied,            // User has explicitly denied authorization for this application, or
                                                 // location services are disabled in Settings
    kCLAuthorizationStatusAuthorized         // User has authorized this application to use location services
    

    Example :

    if user clicks on allow then

    - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation 
    {
          [self refreshYourView];
    }
    

    If clicks on don’t allow

    - (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error 
    {
        if ([error code]== kCLAuthorizationStatusDenied) 
        {
             UIAlertView *alert;
        alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"User has clicked don't allow button." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
            [alert show];
            [alert release];
    
         }
    }
    

    EDIT

    Alternate : you can display an alert that ask user to allow location access by enable location service from Settings.

    You can use this on iOS 5.0 and later:

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs://"]];
    

    in your app to open Settings app.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my application I want to display CLLocationManager alert( App name would you like
If using CLLocationManager in your app, the first time a location update is made
I'm working on a location-based app that makes use of the CLLocationManager region monitoring.
I'm writing an app that monitors the user's location. I have a CLLocationManager object
I am using CLLocationManager to get location updates in my app. Is there a
In my app the CLLocationManager is used to get the current user location. If
I'm looking since quite a long time something like a CLLocationManager simulator that would
My app uses CLLocationManager to get location updates from the device. I had assumed
I have an app that uses the CLLocationManager to receive location and heading updates.
With CLLocationManager I can use the following code to determine if I can access

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.