iOS: Control access to camera roll new appear - ios

in my app I use ALAssetsLibrary to load access at photos in camera roll;
The first time I start my app I see the classic message, if I want give the permission to access at the photo library or not.
But I want to test this situation in each case (allow and not allowed) but I'm not able show again this message; I tried to delete app, change number version, change bundle identifier, but nothing!
Every time I run my app it not show me this message and I have ever the permission to access in the library image; I want to test what happen if I select NO.
(I know that I can change this option in general settings, but in this case I control all in viewdidappear)
I want to know what happen If I select no with that message, then is it possible show again that alert?
thanks

Ok I think I got your question. In your simulator just goto Settings-->Privacy-->Photos-->You app.
Just off that switch each time and you will get prompted with that message..!

Once a user has allowed or disallowed you app access the message will never be shown again and iOS save this permission not to bother the user again.
For the iOS simulator you can rest the settings to get the message again.

Related

iOS Terminated due to signal 9 on allowing permission [duplicate]

This question already has answers here:
Toggling Privacy settings will kill the app
(2 answers)
Closed 4 years ago.
I am making an iOS app and I am new in iOS world. In this app, I want to access user contacts. Everything is going good and working well. But I experienced a amazing behavior which I have not seen in Android since I am android developer.
In iOS to access user contacts I am using Contacts Framework. I think it is relatively more easy and fast then anyother else in the iOS. However, I did not able to completely take advantage of that. Let me tell you what I did and what Problem did I faced.
What I have done I cask for permission on ViewController and User is prompt with Dialog asking for contacts permission. If user allow permission, everything goes well, but when user dont allow the permission here comes the trouble.
Accessing User contacts are more necessary since My app's whole working and basic business idea is upon user contacts. Now to handle this, when user Do not allow permission I am showing another dialog telling him that He must allow permission so that App can continue, So far so good.
Now I am taking user to settings where he can allow the permission or he can simply go again back. Now checkout 2 cases
CASE 1: When User come on Settings screen and go back again without
allowing permission
When I take user to Settings screen and instead of allowing permission he gets back to my app I try to show him same dialog again to enable permission in every case. This is going good. I mean for testing purpose I repeat same procedure manytimes, I mean I do not allow my self Contacts permission, It takes me to setting scree, from settings screen I get back to my app and again I am able to see same dialog that took me to settings scree. THIS IS FINE
CASE 2: When User is taken to settings screen and he permits the
permission:
Here when user allows the permission I get message in the log that is "Message from debugger: Terminated due to signal 9". And when I get back to my app, it starts over again. Looks like my app gets re-open or crashed being in background.
Important: For this I examined my memory or task anything that is being performed in background, but there is nothing going on in background. My memory size before crashing is 54.78 mb. And I do not think so it is worth worying.
Any one have idea what is going on??
Your app is not crashing its just forced to restart by iOS with new privacy settings. iOS will SIGKILL the app. (it's default behaviour of iOS). You can checkout - WWDC 2012 Session Videos: Privacy Support in iOS and OS X for more info on this.
This does not hold true for Location permissions.
It is expected behaviour. iOS terminates the app when user changes permission for Contacts, Camera, Microphone and Photos (and possibly some others).

permission to record audio on iOS

I am writing an app that records an audio file from the user. I noticed that when other apps that do something similar are installed, a window is displayed, warning the user that the app wants to access the microphone, and the user has to explicit give permission to the app to do so.
Does Qt have any API that tells iOS about the intention of the app to access certain devices, which would cause that warning window to be displayed?
Thanks!
You don't have to handle it manually. iOS will automatically ask for permission if the user didn't accept it before.
The very first time your app will need microphone, an alert will be displayed. If the user allows it, he will never see the alert again. If he refuses, he will have to turn it ON manually in iOS settings. Nevertheless, there's maybe a way to handle a previous refusing in-app.

Why user will be asked for access photo permission when first launch app?

When the app is first run it asks for permission to access the photos!
What's the reason for that?
One way is run the code one line by one line or Another way is revert code to previous version.
And find from which version, the app become to ask permission at first launch.
Previously, when we enter select photo screen, we would write code to ask the permission.
I also try to add symbolic breakpoints like:
-[UIAlertView initWithTitle:message:delegate:cancelButtonTitle:otherButtonTitles:]
And even find a class dump UIAlertView header in order to add symbolic breakpoint but not work. Add UIAlertController breakpoint also does not work.
The simulator OS is 8.3. And each time I must reset contents and setting to reproduce the issue.
Any hint or good idea will be appreciated!
Finally, I find out the following code cause the iOS system to pop up the "Allow our App to access their photo gallery" dialog. Thanks for Vijay's answer.
[[PHPhotoLibrary sharedPhotoLibrary] registerChangeObserver:self];
Starting with iOS 6, Apple now requires apps to get explicit user permission before accessing Contacts, Calendars, Reminders, and Photos. From the "Data Privacy" section in Apple's iOS 6 Release Notes:
In addition to location data, the system now asks the user’s permission before allowing third-party apps to access certain user data, including:
Contacts
Calendars
Reminders
Photo Library
For contact, calendar, and reminder data, your app needs to be prepared to be denied access to these items and to adjust its behavior accordingly. If the user has not yet been prompted to allow access, the returned structure is valid but contains no records. If the user has denied access, the app receives a NULL value or no data. If the user grants permission to the app, the system subsequently notifies the app that it needs to reload or revert the data.

Make users manually update app

In iOS7 my application is automatically updated... Is there any way I can release an update of my app and make the plist or something so that the app will NOT be auto-updated by the device, but instead users will only get the update if the manually go to the AppStore and update it?
This is not possible. You need to find a way to notify your users their app has been updated. For example, alert your users the first time their open the app that it has been updated.
Clash of Clans app prompts an alert telling that there is a new update available. The caveat is that this is a online game so the user needs to have internet access to play it. If the user expects to use your application offline and you previously stored an information that the app needs an update and you don't allow the user use it can be frustrating.

iOS: Testing device to allow access to photo library...reset setting

I was testing my app, part of which allows the user to take a photo and save it. When the alert appeared on the screen asking me to give my app access to the photo library I accidentally hit "No" (Stupid touch feature : D ). Now each time I run the app I cannot save images. Is there a way to reset that?
Just turn access on in the settings. Settings->Privacy->Photos->Your App.

Resources