I made an app where the users record voice and send the voice to each other. The app is using the media plugin to cordova, and when you press the record button on iPhone an alert pops up and ask the user for their permission to record audio. This happens of course only once, but how can I remove it so it never happens? I have noticed that a lot of users tend to click on no, and then they are not able to record anything if they not delete the app and download it again.
You cannot remove the user permission alert box. Best way to handle this is to check the status, if user has disabled then show alert with instructions how to enable from iPhone -> Settings -> ...
Not sure if the plugin you are using supports status, with native code you can do detect if user has not given permission and display alert.
Related
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).
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.
I am testing an iOS native app on iOS7, which has a feature that access the calendar/album feature of the phone. On accessing the calendar or albums first time it asks the user for the permission, with allow and don't allow. if we click don't allow and exit the app and then again launch the app and try to invoke the calendar or albums, its neither giving me the Allow/Don't allow prompt not permitting me to access calendar/photos.
My question is that is there any way we can invoke the the allow/don't allow prompt the second time when the app is launched, if the user has clicked on Don't allow the first time.
The short answer is no. You can however check if the app has access and if not, prompt the user to enable it on the app settings page and then redirect them to it where they can change it.
Instructions on how to open the app settings page
is it possible to open Settings App using openURL?
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.
I am using core location framework to collect the device location in my iOS app. When i install the app for the first time in device, iOS asks for the user permission with a alert view as below.
Is there any way to disable this default alert view and display a customized message to the user?
I added screen shot where to add purpose message.
Those alerts are system generated and not editable by the developer. If they were editable, then the developer could change the meaning or make it not obvious to the end user what permissions they were asking for.
For user privacy reasons, this prompt/alert is system generated and you can't disable it if your app uses core location.
Having said that, however, you can delay the display of this alert in your app by organizing your code flow such that location services are only called when needed (lazy initialization).
As per apple docs, read notes under method -
+ (BOOL)locationServicesEnabled
Location services prompts users the first time they attempt to use location-related information in an app but does not prompt for subsequent attempts. If the user denies the use of location services and you attempt to start location updates anyway, the location manager reports an error to its delegate.