Get notified when location permission was changed in native iOS setting - ios

Can I register my Swift app to an OS notification about location permission change?
For example, let's say that the current state is denied and then the user is switching to the settings and change the permission to always and then opens my app again. Can I tell that my user had changed the permission and get both the old and the new one or is it too much to ask :) ?
Something like ABAddressBookRef ntificationaddressbook = ABAddressBookCreate(); ABAddressBookRegisterExternalChangeCallback(ntificationaddressbook, MyAddressBookExternalChangeCallback, self);

Related

show recording permission alert if it was denied previously

The requestRecordPermission function memorize user's first time choice & it doesn't show the granting record permission alert if user has previously denied recording permission.
How can I always pop up the granting recording permission alert if previously user denied recording permission?
[[AVAudioSession sharedInstance] requestRecordPermission:^(BOOL granted) {
if (!granted) {
// Microphone permission is not granted previously,
// How to pop up granting alert/dialog again?
// (My app supports iOS 7 and above)
}
}];
I know how to detect whether the permission is granted or not, my question is about after recording(microphone) permission has been denied once, how can I present the granting permission alert again to user?
(My app needs to support iOS7 and above)
Actually it's not possible to show permission alert again!
check out this SO post:
Request permissions again after user denies...
It says-
The OS will only ever prompt the user once. If they deny permission, that's it.
Following the Apple guidelines, you should simply show a message to the user explaining why he can't use the record feature.
A simple "How to enable my record permission" will do the job :)

Ios Location Permission is displayed even before App is launched and disappears Also didFinishLaunchingWithOptions is not called in this Scenario

When i delete the app from Iphone and Run my project again The app is installed and Location Permission is asked even before the app is launched after that it disappears too quickly before user can interact with it. In this scenario the breakpoints in didFinishLaunchingWithOptions and main.m is not working at all but the app is Loading the first screen And Notification permission is Loading .I cannot forward the app to signup screen since the app requires Location for finding the nearest counties users can register But when I stop the project and run again everything is working as it should be I cannot find the reason for this problem How is the app asking for permission without even entering didFinishLaunchingWithOptions? And proceeding to first page in storyboard without even entering viewdidLoad of that particular class
If you once allow or granted the permission then it will not ask second time. So your flow is normal. Location service asks for permission with high priority so it will shown little bit earlier. If you want this on sign up screen then you should implement that code in your viewDidload of signup screen.
Update : (In response to comment)
If you uninstall or delete app from device or simulator that means you are deleting it's all data and configuration or settings(include your location permission). So, if you install it again then there is no permissions set in your device's setting app for your app. So, you got asked again for permission. that's it.

How to get IOS to ask users whether they want to allow application to use their location everytime?

If we try to access the user's location, iOS will tell the user that our application wants to use their location.
If I do this
[locationManager startUpdatingLocation];
An alert will show.
However, that only happens once.
It looks like some variable or default must have been set up once that display pops out.
How do I reset those default so that next time my app wants to use location users will be asked again?
Google map can displays that again and again.
It's Apple that asks them for permission, not you
Translation: You don't have any control over that part of the process. The little popup:
is only shown by Apple when you first ask for it - so the user always feels in control. After they accept for the first time, Apple assumes they are OK with your app getting their location information from their device, and won't show it again*.
*Unless they specifically go into Settings and disable Location Services for you app.
It's only showed on the first time and there's nothing you can do to change that. What you can do is ask your users to allow it on settings.
You can check if your app has permissions by checking:
[CLLocationManager locationServicesEnabled]
From the docs:
The user can enable or disable location services from the Settings application by toggling the Location Services switch in General.
You should check the return value of this method before starting location updates to determine whether the user has location services enabled for the current device. If this method returns NO and you start location updates anyway, the Core Location framework prompts the user to confirm whether location services should be reenabled.

iOS MapKit not asking for location permissions

It seems that once the user has denied the application permission to locate her on the map, any subsequent call to [locationManager startUpdatingLocation] will fail, but will not automatically prompt the user to set the correct permission in the settings as the iPhone map app does.
Is this behavior intended on iOS6, or is there a way to force MapKit to ask the user again for permission to use her location?
This behavior is intended. Once the user denied the permission then you can't ask it each time your app starts, if it do it'll be very annoying to user.
If user wants to give permission later, he need to go to settings app and set the necessary permission.
It's same for all type of permissions like location service, push notification, contact permission, photolibrary etc.
You should use the delegate method locationManager:didFailWithError: and look for a kCLErrorDenied.

How to give blackberry application all the available permission?

I'm developing using JDE 4.5 which doesn't contain the PERMISSION_RECORDING,
and it's denied by default in 4.6 and higher devices.
So I want my application to have this permission or all the possible permissions that it can get.
Thanks in advance.
You can't set app permissions pro grammatically. What you can do is force Request Permission dialog to appear, see How to - Display custom messages in the request permission dialog
So what you can do is do some test recording on application startup, then Request Permission dialog will come up. It would come up anyway, but on startup this will be more in place, and more, you can set your own message text there.
UPDATE
If permission is set to Deny than there will be no Promt Dialog on denied action.
Then you can use ApplicationPermissionManager to invoke permission request:
ApplicationPermissionsManager manager = ApplicationPermissionsManager
.getInstance();
int current = manager
.getPermission(ApplicationPermissions.PERMISSION_SCREEN_CAPTURE);
if (current != ApplicationPermissions.VALUE_ALLOW) {
ApplicationPermissions permissions = new ApplicationPermissions();
permissions.addPermission(ApplicationPermissions.PERMISSION_SCREEN_CAPTURE);
manager.invokePermissionsRequest(permissions);
}

Resources