not able to delete my ios app (completely) - ios

I am trying to delete my app from my device. But there's some problem.
Actually am using a AvAudiorecorder, in which, when thje recording code is executed the device asks to allow/disallow the microphone(from ios OS). The problem is am doing some testing for that app. when I choose an option from them, the app doesnt prompt the allow/disallow options again , even after deleting the app from the device.
i.e. when i reinstall, the settings under microphone automatically shows his name. but which is not the case when I run on the VERY first time on device.
I read how to delete app from ios simulator and device, they are not working.
Please Help.

In your device's settings. Go to General - Reset - Reset Location & Privacy

I had the inverse problem; I had an issue in my app where the unnecessary use of AVAudioSessionCategoryPlayAndRecord was set causing unnecessary microphone usage prompting, settings, etc. My app update got rejected so I fixed the app to set only AVAudioSessionCategoryPlayback but I kept seeing the old state in settings->privacy->microphone until I followed this answer.
Interestingly, my app has been again rejected post fixing so I suspect that the app review team have not performed this important reset of the test environment.

Related

iOS13 automagically remembers app permissions after deleting app [duplicate]

I'm trying to recreate the condition where the following code returns AVAuthorizationStatusNotDetermined:
AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
However, the iPad appears to remember camera permissions even after the app is deleted and reinstalled, and so either Authorized or NotAuthorized is returned every time. Any idea how to reset the permissions so that NotDetermined is returned?
Thanks for reading.
You can't reset the permission programmatically. If you want to reset the permission there are two ways:
Reset the OS
Uninstall the app and wait for a day
I know both of those options are really not helpful for a developer, if they are trying to test it out something.
There are three alternatives for testing your app's first run scenario without resetting the entire OS or waiting a day.
First option
As described in Technical Note TN2265 :
You can achieve the latter without actually waiting a day by following these steps:
Delete your app from the device.
Turn the device off completely and turn it back on.
Go to Settings > General > Date & Time and set the date ahead a day or more.
Turn the device off completely again and turn it back on.
Second option
When you delete an app the iOS keeps the permission of your app mapped to your app's bundle id, it keeps the data for day. So you can also change your app's bundle id to test it out.
Third Option
As suggested by #rmaddy in the comment you can reset all location and privacy permissions : Settings -> General -> Reset -> Reset Location & Privacy.
Note that this will reset all location and privacy permissions for all the apps on that device.
This is no longer an issue if you update OS version on your device to the latest. It didnt work on 13.3.1 but it did clear permissions after 13.4.1
On iOS 14 go to Settings->Privacy->Location Services, select the app and for allow location access pick "Ask Next Time"
What worked for me:
Windows -> Devices And Simulators -> Installed Apps section
Remove the app from there using the - button.

iOS Simulator would like to access microphone every time

Since the update to macOS Mojave, I get this alert every time I run on the simulator:
"<AppName>" would like to access the microphone.
It is stopping the simulator from running!
How can I stop it?
What worked for me was to change the Hardware Audio Input to Internal Microphone.
What I believe happen is that when you give access it changes the audio input to your headphones or macbook.
My concern was that I am watching a tutorial and it keeps changing the audio frequency and it kept bothering me.
My app does not use microphone, it only plays videos. I was able to fix the alert popup by restricting Microphone access for Xcode in Security & Privacy -> Microphone
This has been resolved in Xcode 10.2 Beta. Installing the beta should also fix it for older Xcode versions since CoreSimulator.framework will be upgraded (and remains backwards-compatible with older Xcodes).
The new behavior prompts for Microphone access once on your Mac. That approval (or denial) covers all processes in all Simulator runtimes including new runtimes downloaded and new Xcodes installed after the initial approval prompt.
The normal TCC rules continue to apply inside Simulator. Your app must have the relevant Info.plist keys with a microphone usage description if you actually attempt to record audio. This will continue to generate an iOS TCC prompt inside that specific Simulator. If your app only plays audio then no TCC prompts will be generated by iOS.
What fixed this for me was to Not Allow the microphone access for xcode. After selecting this option the popup no longer appeared after further restarts.
Unfortunately the previous fixes did not work as Xcode was not available in:
System Preferences -> Security & Privacy -> Privacy -> Microphone (No Xcode listed here)
Go to "Security & Privacy" Settings on macOS
Select "Microphone" on the left panel
On the right panel disable the option for Xcode
There seems to be two issues here: microphone access for both Xcode and the app itself.
Your app (or a UITest) can prompt (fail) for either or both, though not always on same run.
Both of these dialogs must be approved to allow access, after which the permission persists between Xcode and Simulator resets or restarts.
You can confirm access has been approved for Xcode in System Preferences -> Security & Privacy-> Microphone, where you should see the Xcode in the UI.
The app itself, approved or not, won't appear in the UI here, however.
If you are unsure it the app has been approved, reset all the microphone permissions with 'tccutil reset Microphone' in the Terminal, and re-run your app/test, until both dialogs have been shown and approved.
Try starting the app on the simulator not from Xcode, but from the app's icon.
The dialogue will appear one more time. Answer it and it won't appear again.
In Simulator Go to Settings -> General -> Reset -> Reset Location & Privacy and then press "Reset Warnings" when asked.

Access is not requested again after reinstalling the app in iOS12

After updating to iOS12 and testing the apps build in Xcode 9, we found out that after deleting and reinstalling the app - the user is not prompt again with a question regarding access to the Camera or Gallery.
On iOS11, every time the app is installed, iOS asks for permission.
I tested few random apps from AppStore to see how they behave and the conclution is - some of them do reset the access and some don't. So, I'm completely lost.
Also, as an info, but I'm not 100% sure about this: when there is a time period between deleting and installing the app (more than 1h), even on iOS 12 is asking for permission.
Is there any change there in iOS 12? Do you have any clue how to keep iOS 11 behaviour instead?
Thanks!
The only certain way to test the authorization request process again after deleting your app is (and always has been) to go to the Settings app and choose General -> Reset -> Reset Location & Privacy. This is a major pain because you've now reset all your location and privacy settings.
My other suggestion (and it's only a suggestion) is that you try restarting the device after deletion of the app. Maybe, just maybe, this will cause the device to write something out to disk that will cause it to forget about its previous authorization of this app.

Silently Updating iOS Enterprise Apps in Single App Mode

I have a need to update my managed app running on a large amount of iPads without any user interaction. These devices all have the managed app locked in Single App Mode. As I understand it, it's an iOS limitation that an app cannot be updated if either of the following conditions are present:
The app to be updated is in the foreground.
Any app is locked in Single App mode.
With our use case, both of these conditions are present. I also understand that the current workaround is to do the following:
Disable Single App Mode.
Enable Single App Mode for a different app (e.g. Safari) to bring that app into the foreground.
Disable Single App Mode.
Update app.
Re-enable Single App Mode for your app when the update finishes to bring it back into the foreground.
While this method works, it has a lot of drawbacks:
It's highly manual, we have not found a way to automate it. This is especially a problem as the number of devices becomes large. Internet connections can be spotty and there is no robust way to ensure that each step has executed for all devices.
It's prone to failure. Especially between steps 4 and 5 above. It seems there are little to no guarantees of when/if an update was successful to know definitively when to re-enable Single App Mode.
It fails for devices that are offline at time of update. If a device does not have internet connection when the update is executed, there is no way to guarantee that the steps execute fully and in the correct order the next time the device comes back online.
I am looking for a scalable solution to reliably update my managed, Single App Mode app running on thousands of devices in an automated way with no user interaction. I am using Meraki for an MDM right now, for what it's worth.
With iOS 11.2 you can now push a silent update to a device with it running SingleApp mode.
Apple failed to mention this to the public but is included in the beta notes.
Called Enterprise Support today, They could not find any official documentation mentioning ios 11.2.x supports the updating of apps while in single app mode :(
Now with iOS 11.3 beta it is working again but after updation, app is not automatically locking in Single App mode we have to restart device.
Hope in upcoming beta's this issue will get addressed.
iOS 13.1 beta 1 seems to fix most of the issues I have been having in this area.
I had seen issues in iOS 11-12.* where updates sometimes worked, but sometimes showed a pin-pad even though no passcode or guided access code was set, or otherwise behaved strangely.
In the 13.1 beta 1 you can push an App update and nothing will happen on the device, but if you send a restart command afterwards the device will restart, update the App and continue in single app mode.
I have tested with both 'Single App Mode' (SAM) and 'Autonomous Single App Mode' (ASAM) and it has worked every time for me so far.
This works for my use case as you can push the update anytime and schedule the restart at suitable time when the device is not in use.
edit: 13.1 beta 2/3/4 changes this, now when you push an update from your MDM the App will close, update and re-open and continue in single App mode. I checked both SAM and ASAM both now update without the need for a restart.

iPad remembering camera permissions after delete—how to clear?

I'm trying to recreate the condition where the following code returns AVAuthorizationStatusNotDetermined:
AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
However, the iPad appears to remember camera permissions even after the app is deleted and reinstalled, and so either Authorized or NotAuthorized is returned every time. Any idea how to reset the permissions so that NotDetermined is returned?
Thanks for reading.
You can't reset the permission programmatically. If you want to reset the permission there are two ways:
Reset the OS
Uninstall the app and wait for a day
I know both of those options are really not helpful for a developer, if they are trying to test it out something.
There are three alternatives for testing your app's first run scenario without resetting the entire OS or waiting a day.
First option
As described in Technical Note TN2265 :
You can achieve the latter without actually waiting a day by following these steps:
Delete your app from the device.
Turn the device off completely and turn it back on.
Go to Settings > General > Date & Time and set the date ahead a day or more.
Turn the device off completely again and turn it back on.
Second option
When you delete an app the iOS keeps the permission of your app mapped to your app's bundle id, it keeps the data for day. So you can also change your app's bundle id to test it out.
Third Option
As suggested by #rmaddy in the comment you can reset all location and privacy permissions : Settings -> General -> Reset -> Reset Location & Privacy.
Note that this will reset all location and privacy permissions for all the apps on that device.
This is no longer an issue if you update OS version on your device to the latest. It didnt work on 13.3.1 but it did clear permissions after 13.4.1
On iOS 14 go to Settings->Privacy->Location Services, select the app and for allow location access pick "Ask Next Time"
What worked for me:
Windows -> Devices And Simulators -> Installed Apps section
Remove the app from there using the - button.

Resources