iOS 11 Beacon detection issue when device is locked

Viewed 711

I am developing beacon app and i am using Kontkat.io beacon. Beacon monitoring (enter/exit event) is working fine when app is in foreground and background.

In iOS 11 when app is in foreground its working fine but when device is locked then beacon detection is stopped and no enter/exit event fire. I have checked with lower then iOS 11 version and its trigger enter/exit event if device screen is locked or app is in background. Is it a limitation of iOS 11 or am I missing something?

Note:
I have added NSLocationAlwaysAndWhenInUseUsageDescription in info.plist.

2 Answers

Go to Settings -> Applications -> Permissions and make sure that "always" location permission has been granted and not just "when in use".

Make sure also that you have a string for NSLocationWhenInUseUsageDescription in in addition to NSLocationAlwaysAndWhenInUseUsageDescription in info.plist. Both are required for iOS 11

You also may want to uninstall and reinstall if you have previously build and installed with XCode 8. Make sure you see the permission dialog and choose the "always" option.

I'm not sure this is an answer, more my findings that contain a possible answer.

I too have been seeing this problem across different devices and different setups.

I've found that if I have a completely "fresh" iPhone that's not restored from an iCloud backup, nor logged in to an iCloud account, it will work. If I restore the same device from an iCloud backup linked to my iCloud account, it doesn't work.

I've done this several times over several devices and the results are the same using my iCloud account.

I've tried the same test with other people's iCloud accounts (and restoring iPhones from an iCloud backup they have) and it doesn't seem to happen across all iCloud accounts.

I thought I was getting close to a solution when I seemed to be able to get it to work by turning off "iCloud Backup" but that seems to have just been a coincidence.

Try running your app on a "fresh" iOS device and see what happens.

Related