iOS 8 - Changing permissions manually - ios

I am developing an application for iOS 8.1.2 and i make requirement permission to CLLocationManager, but if the user does not accept permission and go to panel settings and try to change the privacy settings, the settings close at the time of selection (like a crash) and if user return in the settings panel , it is still selected the "Never" option.
Problem: As much as you try to change this permission it will never change. It happens to the application in the background or completely inactive.
My Problem not in code to get location and not in code to request information. Is in the change permission of my
application on device.

Related

(Swift) Location permissions toggle not showing up in settings

I am working on a Swift app that uses location permissions and I am encountering an interesting problem. If Location Services are disabled for the device, and you open the app for the first time the authorization alert view says you must go to settings and enable this. If you go to settings and then enable location services and then go to the apps section in Settings, the Location toggle section is not there, only the Siri & Search section is displayed (see the picture for what I am talking about).
The only way to make that section appear is to kill the app completely and re-open it. Is there anyway I can have that section appear at all times? I am using a Settings.bundle with nothing in the root and I am asking for WhenInUse permissions.

Camera and Photos permission - iOS [duplicate]

In my iOS app I am accessing the user's photo gallery. The first time the user does this, it asks them for permission. Some of my users have reported getting a crash this first time due to the permission request, but it works fine on subsequent tries.
To be able to test this on my own, I need to be able remove the permission from my iPad and have it prompt again. Is there a way to do this either through the iPad/iPhone itself or through code?
Run the Settings app. Go to General, then Reset. Tap on Reset Location & Privacy. This will reset all of your location and privacy settings, not just for your test app. But you are doing this on a development device so that should be OK. This works in the Simulator too.
In iOS 7+, you can go into Settings > Privacy > Photos and explicitly enable or disable access for individual apps.
This is much better than resetting your entire device privacy settings!
Another way is to temporary change Bundle Identifier (CFBundleIdentifier) in Info.plist.
System will treat such app as a new separate app and will display "would like to access your Photos" alert.
Don't forget to revert CFBundleIdentifier after you end testing.

Unable to simulate location on Xcode Version 9.0.1 (9A1004)

I'm working on a project where it's very often necessary to change the user's location, of course I included all the necessary data to simulate the location from the very beginning of the project. Today Xcode does not pretend to be a custom location, I decided to try to simulate one of the standard locations (for example San Francisco), but when I launch the application on a real device, my real location is displayed on the real device. I tried to run the application on the simulator, but got the same result. I did a clean project, rebooted the real device (iPhone 7), rebooted Xcode but it did not give results. I read a few topics, but they all relate to the fact that the developers did not include the simulation of the location in the scheme. How can I fix this problem? Thank you.
Update: I've updated Xcode, now I'm using Version 9.1 (9B55), but this did not fix this bug. Sometimes (once a week approximately), Xcode refuses to simulate even standard locations from the list (for example San Francisco). Although the menu above the consoles shows that the location simulates.
Info.plist contains
<key>NSLocationWhenInUseUsageDescription</key>
<string>Turn On Location Services to allow App to show you Events near you.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>Turn On Location Services to allow App to show you Events near you.</string>
<key>NSLocationUsageDescription</key>
<string>Turn On Location Services to allow App to show you Events near you.</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Turn On Location Services to allow App to show you Events near you.</string>
Update 1: Xcode does not simulate the location only on a real device (iPhone 7), two weeks ago there was no such problem. When I call CLLocationManager to show an alert, this alert on the real device is not shown at all. I repeat, this problem does not always repeat, this can happen once a week, but no methods help to restore this possibility to a working state.
I got the same problem and here's my work around.
You know the Location Services is not working when you don't see the arrow on status bar when you request location. So just turn Location Services off and on again. I guess this is a bug.
Go to Phone Settings > Location Services... then turn it off and on.
Xcode > Debug > Location Simulation
Simulator > Debug > Location > Custom Location (this will take what you set from step 2.)
You should see the arrow on status bar when you request location. If not... try the steps again.
First of everything ... Warning! , read this (from apple):
You are required to include the NSLocationWhenInUseUsageDescription and NSLocationAlwaysAndWhenInUsageDescription keys in your app's Info.plist file. (If your app supports iOS 10 and earlier, the NSLocationAlwaysUsageDescription key is also required.) If those keys are not present, authorization requests fail immediately.
Anyway, i just suggest make a simple test.
Make sure that you set Allow Location Simulation on the Run Scheme for your Debug Build Configuration on your target-
Run your App, switch to the Map app on simulator (is is the rfirst time you use, make sure you accept allow location dialog). -
Change the location on the location icon on Xcode (see below), and check that the map move to that location-
If everything is ok, the map app must show selected location
If your app is not able to follow same behaviour, maybe you are missing something. Further reading:
About Location Services and Maps
CoreLocation Framework Reference
Cheers.

Why does my PhoneGap/Cordova app's Location Services privacy setting disappear?

I am preparing my PhoneGap/Cordova-based app for use on iOS 8. I am using Xcode 6 and PhoneGap/Cordova 3.6.3. My app requires location services permission.
iOS 8 is not storing or maintaining state on the location services. In fact, it's not asking the user for permission to access location services.
If you go to Settings>Privacy>Location>Bike Guide, you'll see that no setting is checked. If you check "Always" and leave Settings.app to enter Bike Guide.app, the setting is quickly lost (see screenshot) and Bike Guide.app cannot get the device's location.
How do you fix this?

Resetting iOS 7 microphone access permission

How do I reset the microphone access permission so that the app will ask for microphone access permission again as if it were downloaded fresh from the App Store?
Reinstalling the app does not accomplish what I need. When I set the permissions in Settings->Privacy->Microphone, I can only turn permissions on or off. I need to reset it so that it asks for permissions again.
You can RESET your privacy settings in iOS Settings.
Settings > General > Reset > Reset Location and Privacy.
NOTE: Privacy settings for all apps will be reset.
At least starting from iOs 7.1.1 there are switches to change access permission for every single app.
Look in: Settings->Privacy, select the kind of subsytem of your interest ( eg: microphone ), you will see your app in the list. Change the value of the selector according to your needs.
Have a nice day, Stefano
If you change your bundle identifier, that'll also reset the permissions for your app.
Permissions for an uninstalled app are reset after a day.
So, if it is not urgent, you can wait for it reset. I know this is not an ideal solution but it is app specific
Following on from Stefano's post - if you'd like to direct your user directly to the microphone settings then you can use:
let app = UIApplication.sharedApplication()
app.openURL(NSURL(string:"prefs:root=Privacy&path=MICROPHONE")!)
(at least on iOS 9 - if the Settings app structure changes, then the link will likely need to change)

Resources