Can I bypass “AppName would like to Use your current location” Message - cllocationmanager

I want to bypass “AppName would like to Use your current location” message, with "Allowed" state.
Is it possible?

No, you can't bypass the message. Your app need to get user's permission to use user's current location.

Related

About iOS popup asking user to continue allowing the app to use location in the background

I want to ask and to get better understand about the popup that iOS will occasionally ask the user like :
"Weather" has been using your location in the background. Do you want to continue allowing this ?
How often dose this occur and how do they determine when to ask ?
And is it possible to prevent this to show to the user ?
I can't find any documentation, the only explanation i can find is from the presentation from WWDC 2014 video "What's New in Core Location".
Thank,
Pat.
The user has to agree to letting the app use their location. Generally speaking the dev will only ask to use the users location when needed ie if they are searching for something on a map to compare to where they are currently. Once the user has agreed to let the app use its location it isn't asked again. From then on you check for updates in the users position.

Programmatically request location updates permissions

How do I programmatically request location updates permissions?
I mean, I what to control, when does the native popup asking for "Your current location" pops
purpose:
I what to control that if there is no permissions, to present something and only then to ask for them (apple native popup). How to that?
You don't control the "Apple native popup".
You know whether the desired services are available through CLLocationManager class methods (locationServicesEnabled, authorizedStatus, etc). If location services are switched off, you can just start using a location manager anyway (e.g. startUpdatingLocation) - that is your only way of getting the system dialog asking the user to switch them on. Be prepared for the possibility that the user won't do so.
Of course nothing prevents you, having detected that you have been denied authorization, from putting up your own alert requesting that the user switch to Settings and authorize you.

If an iOS consumer denies permission to 'Use Current Location', is it technically possible to show the permission dialogue again?

My iOS app wants to display the users current location. Nothing special - but to do so, the first time the app is ran (or more to the point, the first time an MKViewMap in the app is displayed, I guess...) .. the user is asked for permission (which is awesome).
eg.
Now, if the user accidentally says DON'T ALLOW or decides to (later on) give permission ... is there technically a way we can reset their previous decision and when the app is restarted, ask them again automatically when the MKViewMap is next rendered again?
The user can enable or disable that option in the setting of the iphone. To do this, user have to select the Privacy option in the Setting Menu, and then select the Location Services option and than search the desired app to whom user want to enable or disable the permission and perform desired function by switching the toggle button on or off.
As it was a Private API provided from Apple the alert cannot be shown up again. Alternatively, we can check manually and show an alert like this.
The following can be read in the Apple docs:
"...it is recommended that you always call the locationServicesEnabled class method of CLLocationManager before attempting to start either the standard or significant-change location services. If it returns NO and you attempt to start location services anyway, the system prompts the user to confirm whether location services should be re-enabled. Given that location services are very likely to be disabled on purpose, the user might not welcome this prompt."
If I understand it right the alert will pop up everytime you try to get the users location, but it's not recommended to do so.
Link to full post:
https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/LocationAwarenessPG/CoreLocation/CoreLocation.html#//apple_ref/doc/uid/TP40009497-CH2-SW1
No you cannot do so. Rather than this, you can just check the latitude and longitude value and show alert to the user that enable the service from settings.

How to ask user permission for using Geolocation again after user has denied it once?

In Windows 8, javascript metro apps, if the user denies the permission to use Geolocation, then the permission always remains denied.
Maybe the user denied permission to use Geolocation when using the app for the first time but later might be willing to allow use of geolocation as trust is built. But I could not find how to ask for permission again.
Even in the Win8 Geolocation sample, once the permission is denied then it remains denied and there is no way to ask for permission again.
Is it possible to ask the user for permissions again?
You can always prompt the user with a flyout or a message dialog, you just can't initiate a geolocation query and cause the core capability question to fire. Users will learn soon enough that capabilities are configurable in your apps Settings | Permissions flyout and you can even point them there to change their answer.
In other words, I think the platform is avoiding the scenario where the user says, "Would you leave me alone?! I don't want to be bothered about my privacy!" and if the developer is careful about his workflow then I doubt it will be too difficult to avoid the scenario where the user says "Hey! I want to this app to get smarter about my location but I don't know how to enable that."
Subjective I know, but you can see how it favors the user.
You could do a Toast notification but like Jeremy says if you get to annoying with it you could drive users away.

Asking user permission for accessing their location with iOS when mapView does

I've developed an app using a MapView - when the app starts up, it asks the user to allow their location to be accessed/used without any coding from me. Is this sufficient for permission or should I also specifically ask the user and provide a reason for the access? Will Apple reject the app on submission if I don't specifically make the request and allow the MapView to request this on my behalf?
You don't need to ask the user for permission, iOS does it for you automatically.
You should set the purpose string property in the CLLocationManager object so that when the system asks it can also tell the user why you want their location.
locationManager.purpose = #"Location needed to show zombies that are nearby.";
Set this property before calling startUpdatingLocation so that it gets shown to the user in the system alert that asks for permission to use location.
In the delegate you can implement the method locationManager:didChangeAuthorizationStatus: to know whether the user allowed core location or not.
As of iOS 6, the correct place for the "purpose" message is in the Info plist file.
The NSLocationUsageDescription property should be set with the message to display to users
Apple provides good documentation:
https://developer.apple.com/library/mac/#documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html
You don't need to tell the user why their location is being accessed especially if the application is based on location and mapping. With that said it is nice to tell the user what exactly you will do with their data before the permission popup comes up so that hopefully more users will accept.

Resources