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.
Related
I was using the intent with android.provider.Settings.ACTION_SETTINGS to show the system settings screen from inside my app, to allow the user to configure certain details, like a bluetooth keyboard or adjust the timezone. This was working very well in the DP5.1.
But now in the DP6, the intent
startActivityForResult(new Intent(android.provider.Settings.ACTION_SETTINGS), 0);
Does not work anymore. No exception is logged in the console.
Any workaround on this?
THe option to install the apk after configuring the device with the IOT_LAUNCHER screen is not very practical for me. Because I want to deliver an image with a bundle, and my app will be started automatically, not allowing the user to see the IOT_LAUUNCHER screen.
Thanks.
In DP6 the Settings application is either deprecated or removed. APIs to modify the screen or time have been added.
Are there any classes or frameworks out there that allow my app to access and modify iPhone settings of the device used to visit my app? I know there's plenty of apps out there which (for example) can change the screen brightness of the device, so I was wondering if it's also possible to modify other settings you can manage in the Settings app on your device (i.e. automatic device lock, time and date, etc.).
No this can't be done... What you can do is to open the settings and that's it. Apple does not allow you to change anything outside your application.
I am working on an app in which I need to open the device settings app on button client rather than app settings. I am using UIApplicationOpenSettingsURLString - but this opens the app settings page not the root level for device settings.
So, may I please get some suggestions on how to open the device settings app and may I also know is there any possibility to open the wi-fi settings page in the device settings programmatically.
You con only open the app-settings as you mentioned above.
If it would would it would also be listed in the documentation:
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplication_Class/#//apple_ref/doc/constant_group/Settings_Launch_URL
Even Apps like GoPro or Twitter just give instructions how to enter the settings rather then linking directly.
When I develop an app for iOS (iPhone/ iPad) and I need to request permissions. When I use the camera I need to request the camera permission. This can only be done once.
Is there a way to reset initial given permissions at least when I develop an app?
In this way I could check different scenarios for requesting the initial app permissions.
Note: I want to get the initial permission request popup message again.
Settings > General > Reset > Reset Location & Privacy.
This will reset all location, camera and microphone permissions.
It cannot be done on a per app basis.
Another way around this is to change your bundle id. With each new bundle id you provide, it is like a fresh install of the app. Remember to change it back to the original bundle id after testing :)
To reset all the Location & Privacy permissions you can go to:
Settings > General > Reset > Reset Location & Privacy
To view what Apps have what services and to turn it off for individual services you can go to:
Settings > Privacy > The service you want to view
Here you can turn off the service for individual apps, note that this doesn't mean you'll get the popup message again it just means that app will not use that service.
What worked for me:
Windows -> Devices And Simulators -> Installed Apps section, remove the app from there using the - button.
This resets the permissions every time with a fresh install afterwards.
If testing on a real device, uninstalling the app seems to work for me.
Another way to reset permissions on iOS simulator is to delete the appropriate database row from the access table in $SIMULATOR_DEVICE_DIRECTORY/data/Library/TCC/TCC.db. This can be done per app / service basis.
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)