iOS location permission after app reinstall - ios

I’m using Crashlytics for internal application tests and noticed one interesting thing. I’m using geolocation in my app and asking for permissions from a user. When customer install app for first time he sees default Apple’s geolocation permissions asking pop up. And everything work fine.
But, if user will remove app from phone and install it again... in this case, when I’m asking for permissions, pop up just won’t appear BUT geolocation is WORKING. How? Is this some sort of new feature or iOS issue? I were testing with iOS 11.0.3. I haven’t found anything in documentation, and haven’t seen this behavior in previous iOS versions. Looks like iOS just memorize the app and automatically enables geolocation when I’m asking for user permissions instead of showing pop up.
Maybe someone has answer for this?

it is possible that there could be a mistake in your code pattern while checking authorization status, the behavior you are seeing is likely due to iOS caching location permissions for apps.
In your code, make sure that you check authorization status (via the authorizationStatus() method), and continue with requesting location authorization when the current status is .notDetermined (kCLAuthorizationStatusNotDetermined)
iOS does cache authorization status for apps as well. If you would like to reset your location permissions for testing purposes, you can set your location privacy settings to the factory default: go to Settings > General > Reset and tap Reset Location & Privacy. When your location and privacy settings are reset, apps will stop using your location until you grant them permission.
Unfortunately there is no developer control over this.
Caching of permissions for apps is in an ever evolving stage, where we are trying to find the best user experience, so you may have noticed some changes lately. Also, there will be a grace period where the app uninstall to reinstall time might be making a difference.
If your observations of apps that behave like you expected are recent (on the same version of iOS that you have observed your app behave differently), and the uninstall/reinstall time difference is immediate (like how you probably test your app), please let me know which apps, and I will see if I can dig some information.

Related

Force removal/invalidation of iOS app from user devices

Assuming you created an app that users have downloaded that is just awful and you neither want to fix it nor have anyone continue to use it so that it won't tarnish your brand, is there a way to end its life on user's iOS devices?
Curious if there is some store setting to force it to work with earlier versions of iOS and invalidates the current app, or code that would force an update that says the app is no longer available.
As many have confirmed, there is no way to remove an application from someone's device. For these cases though, many companies have servers that the application sends a request to on launch, that returns either a need to update the app, a message, or to tell the user the app has been discontinued and that the app cannot be used anymore, stopping them from using the app from there on.
The last use case might be useful to you, but of course this is a proactive solution, not a reactive one.

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).

Location Background Mode Always or WhenInUse

I have two apps built that use your location similar to a run tracking app where I use the location in the background but only when you are actively tracking a run. This works in iOS 11 after only requesting WhenInUse authorization and you get the top blue bar when you leave the app. Both are in the app store but in my most recent submission I keep getting rejected with the following response:
Regarding 5.1.5, the current modal alert available to the user requests permission to access the Foreground Location. However, your app does not request and obtain the user's consent prior to accessing their background location data, which is not allowed on the App Store.
Is this something new and they just haven't noticed before? I also checked Google Maps and Strava and they both use my location when I'm actively using it even when they are in WhenInUse mode.
I would prefer to use only WhenInUse mode as I think it more clearly conveys to the user what the app is doing. We never use your location when the app isn't recording a run.
If you can link to Apple documentation about this situation it would help even more.

Something wrong with my iOS app's location service declaration

A few days ago when I uploaded a new version of my app to the App Store using Xcode, I received the following e-mail from iTunes Connect:
Subject: iTunes Connect: Your app AppName has one or more issues
Dear developer,
We have discovered one or more issues with your recent delivery for
"AppName".
The following are for your information only and do not require any
action:
We have detected that this build requires the use of standard location
services when running in the background. Apps requiring location
services will now display the following text disclaimer on the App
Store. 'This app may use your location even when it isn’t open, which
can decrease device battery life'.
Regards,
The App Store team
And the build that I uploaded cannot be selected for review submission on the iTunes Connect website.
How should I deal with this problem? Thanks.
I run into this issue long time ago, this is because, if your app is still use location service in the background, it maybe consume the battery.
1) If you want to always use the location service, you should set this, can let you pass the itunes verify:
you should in your Info.plist add NSLocationAlwaysUsageDescription permission, and set the value, why you want to always use the location service.
2) If you just need when user using app this duration to use location service. You should NSLocationWhenInUseUsageDescription instead of NSLocationAlwaysUsageDescription permission, and you should also set the description why you want to use the permission.
Apple guidelines *
If your app requires location usage even in the background mode, In bottom of the app description and iTunesConnect application page you have to put this text
"This app may use your location even when it isn’t open, which can decrease device battery life"
It is important to put this disclaimer so that if user downloads your application he should be aware that location services will be active for the app even when the application is not in the use.
You don't have to put another build, just update the description with this disclaimer and submit for review again. It will get re-reviewed and, if all terms and conditions are valid, it will be approved.
Since Apple services for new application upload is not active from 23rd Dec to 27th Dec due to yearly Christmas holiday, so you should try to submit for review after it.
Let me know if you have any issues.
While going through the same issue, I found that
Capabilities -> Background Modes -> Location updates
were enabled for my app.
Please deselect this, if your app does not require location updates in background.
This is not a big problem actually. Apple reviewer already said you "do not require any action" he / she only suggest you it is more appropriate show a warning text (it is appear when you request to use location service within UIAlertView) like this message 'This app may use your location even when it isn’t open, which can decrease device battery life'.
You can add descriptive string in .plist file.
Probably you forgot to add NSLocationWhenInUseUsageDescription or NSLocationAlwaysUsageDescription in plist or you didn't add background mode in capabilities of the project.
The problem is with your string message you are displaying. i was also once stucked in this kind of issue i was using app name like "Burn you phone". So by changing the message string on location authorization will do the trick.
I had the same problem and contacted iTunes Connect about it. Below are excerpts from their responses so far:
I do understand your concerns about continuing to receive notices with
every update or build. I can confirm this is working as expected.
...
There are some emails that are system-generated by iTunes Connect and
there is not a way to disable them at this time. If you provide us
feedback we will be more than glad to provide it to the appropriate
team for future improvements.
...
You can definitely try adding the app description and see if this will
resolve the email notifications.
However, we can not assure you that this will cancel the email
notifications.
Just wanted to demonstrate their stellar customer support and exemplary knowledge of their own product...
However, I haven't yet confirmed whether putting the text in the description field will silence the email.
The other responses here mention the privacy usage descriptions in Info.plist, but this email is not directly related to this issue. Anyways, if you neglect to include those, your app will just crash when you try to access location services (unless permission had already been given in a pre-iOS 10 version of your app).

kCLAuthorizationStatusRestricted is showing up for one of my apps but not another on the same device

I have an app i'm maintaining which recently stopped reporting users locations. This is happening on many devices where it was previously working. On my device I have determined that the auth status of CLLocationManager is kCLAuthorizationStatusRestricted. This stops the app from prompting for user permission.
I have no restrictions set around core locations and another app of mine running the exact same helper class to manage location works fine on the same device. It prompts for user permission as it should.
Does anyone know anything that would cause kCLAuthorizationStatusRestricted to show up besides restrictions?
In the Settings app (in iOS 6) look under General, then Restrictions. If Restrictions is enabled, then scroll way down to Privacy section. This is where Restrictions are set for Location Services.
This is a different set of Privacy restrictions from the Privacy section that is on the first screen that can be locked with a passcode.

Resources