When I'm using ios 11, since it's security permissions have been changed for allowing an app to access users' location, how can we do monitoring(enter/exit) when user only gave us "access only when using the app"? is there any way at all that we can do monitoring without that permissions?
Asked
Active
Viewed 374 times
1
-
No, if the user only gives "when in use" location permissions then you can't monitor their location when your app isn't in the foreground. – Paulw11 Apr 05 '18 at 13:22
-
So basically it doesn't make any sense to use beacons these days I guess, at least not as useful as it can be, so how about giving permission of "always"? is it like giving access in ios 10 or lower? or it has it's own limits? @Paulw11 – fafa92 Apr 05 '18 at 18:38
-
I guess it depends on your use case. For example, an app that provided indoor mapping and used a beacon to identify where the user is might work quite well with "when in use permission". The user has always had the option to deny your app use of background location, just that now they have an option of allowing your app access when it is in use rather than just denying completely. As David said below, if your app explains to the user why it needs always permission and they see a benefit to providing the access then it works the same as it always has. – Paulw11 Apr 05 '18 at 20:46
-
Thanks for your clarification @Paulw11 – fafa92 Apr 06 '18 at 04:06
1 Answers
1
If you only have "when in use" location permission, monitoring is not useful in practice. There is simply no way to get callbacks when your app is not in the foreground.
When your app is running you may call locationManager.requestState(for: region)
(See here) to see how the region inside/outside status has changed since your app was last running. This is really the best you can do.

davidgyoung
- 63,876
- 14
- 121
- 204
-
So basically it doesn't make any sense to use beacons these days I guess, at least not as useful as it can be, so how about giving permission of "always"? is it like giving access in ios 10 or lower? or it has it's own limits? is it going to show blue bar on the top? or just simply like previous ios using bluetooth in background without user knowing anything of that? – fafa92 Apr 05 '18 at 18:39
-
If you convince your user to grant always permission, then beacon apps will behave just as in iOS 10 and earlier, yes. The trick is to detect when the user has not granted this, and to present them something on the screen that convinces them they should grant this access. You need to explain to the user why it is in their interest and convince them to do so. – davidgyoung Apr 05 '18 at 20:18
-
Yeah I think this is exactly what I should do, but when you are saying that "the trick is to detect when the user has not granted this and to present them something on the screen that convinces them they should grant this access." do you know any example or application that you thought it might be helpful to find out creative ways to suggest users this functionality? – fafa92 Apr 06 '18 at 04:09