iOS, How To Reset All App Permissions for Testing Purposes [duplicate] - ios

This question already has answers here:
iPad remembering camera permissions after delete—how to clear?
(4 answers)
Reset Permissions like Camera for iOS Apps?
(6 answers)
Closed 6 years ago.
I'm wondering if there is a simple way to reset all of the app permissions in the app I am working on. I am switching around the location of the permission in my app, and I would like to test it. However, I can't figure out how to reset these permissions so they will prompt me again. Not sure if these matter but the permissions are Camera, Location, iCloud, PhotoLibrary, and Contact Book.
I have tried deleting the app and changing the permissions in settings, but neither worked.
If this is an in-code answer, I am using swift, Thanks!

Related

Is there a method that gets called on app uninstallation? [duplicate]

This question already has answers here:
Detect iOS application about to delete?
(3 answers)
Closed 4 years ago.
I have a very specific need to handle some cases if my iOS app gets uninstalled. But I cannot find any method so far that gets called in case the app gets uninstalled. I have searched around with similar questions but cannot find anything usefull. Can anyone suggest something please.
No, its not possible.
But you can check if the application has re-installed by storing a key in iCloud using keychain.

Swift: Is there a way to get the running apps in IOS? [duplicate]

This question already has answers here:
How to get information about free memory and running processes in an App Store approved app? (Yes, there is one!)
(2 answers)
Closed 5 years ago.
Is there a way to get the running apps info or the action of openning the app in IOS? There is a way to do that in android with getRunningTasks, maybe there is a way to do that in ios?
At last in non-jailbroken iOS there is no such possibility. The reason is to protect users privacy - app should not know about other apps that are installed on user device (otherwise it could eg. spot business rivals app).

Delete iOS app settings [duplicate]

This question already has an answer here:
Is it possible to reset the privacy settings in iOS?
(1 answer)
Closed 7 years ago.
I'm working on an app that requires requesting mail access. Since the simulator doesn't have a Mail app I've been using my physical device to test the app.
My problem is that I want to test the request to access Mail in relation to the welcome/intro screen that I've made but even if I delete the Xcode build version of the app from my device the settings for allowing the Mail access still persist.
I want to force those settings to delete when I delete my app from the device so that it requests Mail access after every fresh install for the sake of testing. So far the only solution that I've seen for doing this is to complete a fresh install of iOS each time, but that's much to much trouble when I'd be wanting to do it several times.
Does anybody have a solution for this?
The simulator does actually have a Calendar and I do plenty of testing on it. If you want to add more calendars via the simulator, open the calendar app, tap edit at the top and you can enter new calendars.
Here's the solution I found thanks to #Martin R's comment.
Go to General > Reset > Reset Location & Privacy
This reset accomplished what I needed for the problem.
I've myself run into the same problem when allowing photo access.
It's not a proper answer, but the workaround I found was effective: just change the bundle id when you want to test this behaviour. iOS will assume it's a different app and ask you again for all the authorisations granted before.
I'm still interested by the proper answer though — if there ever is one.

can I send a user to the iPhone's lock-screen? [duplicate]

This question already has answers here:
Programmatically lock and unlock iPhone screen
(8 answers)
Closed 8 years ago.
I've seen an app that activates the lock-screen after showing a local notification (so the user has to enter the passcode).
... and now I wonder how they did this, since I need this kind of functionality for one of my projects. It might even pass Apple's review process because it does make sense for this app... (and, yes, I'm aware that Apple might reject it, but I'd like to give it a shot).
How would I do this???
I don't believe it is possible as the framework that handles this is private.
iOS 8.1 does not offer API to do this. Most likely you have seen an App implementing its own lock screen. You will need to implement something similar.
You can find examples on GitHub, e.g. https://github.com/venmo/VENTouchLock

IOS guided access - can app know it is in guided access mode? [duplicate]

This question already has answers here:
Detect or react to Guided Access?
(3 answers)
Closed 9 years ago.
I am developing an IOS app for a class room environment - conducting a test. I have a requirement that the app should not come out during the test. Guided access is a perfect solution for me, since I can force users (students) to turn the device to guided access mode.
What I want is like this: Only after the device is set into guided access mode, the app will proceed from a particular screen. Is it possible for the app to know (programmatically) whether the device is in guided access mode at any point in time? Any documentation available on this?
Thanks in advance for your help
I found a feasible solution. IOS 6 (onwards) has a method: UIAccessibilityIsGuidedAccessEnabled. Returns a Boolean value indicating whether Guided Access is enabled.
It is in Apple's UIKit Reference Manual

Resources