iBeacon Region monitoring: Not resumed when rebooting the phone EXCEPT if I set location background mode?

百般思念 提交于 2019-12-06 13:22:54

问题


all day I tested the monitoring of beacons my app does. in general it works ok:

  • notifications in foreground work
  • notifications in background work

BUT

after a reboot it doesn't work until I launch ANY app that uses BluetoothLE

after I do that it works fine for my app as well!


But if I set UIBackgroundMode location in my plist though, my app gets region notifications just fine even after a reboot.

So... is that it? or whats the deal here? :D this is under ios 7.1.1 btw

The code is very minimal: https://github.com/RadiusNetworks/ibeacon-background-demo/blob/master/BackgroundDemo/BDAppDelegate.m


回答1:


I did two things:

First, I reduced the time it took the app to launch >> mainly by doing stuff only when the app moves to the foreground. That was Step 1 but for the real app I was working on that alone was only half the solution

I then found out that the application in question tried to access the keychain in the background while the device was locked I moved that to a later point too and BING it worked!



来源:https://stackoverflow.com/questions/23711378/ibeacon-region-monitoring-not-resumed-when-rebooting-the-phone-except-if-i-set

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!