Trigger an event when Dark to Sleep ends

hi,

For IOS, since the beacon doesn’t completely stop broadcasting, is it possible to trigger some delegate methods (such as didrangbeacon or - centralManager:didConnectPeripheral:) when beacon restarts broadcasting, even when the app is suspended or killed?
For a simple example, the beacon is in the pocket of the user (dark-to-sleep and always in range), when he takes out the beacon (light sensed, starts to broadcast), iphone will send a UILocalNotification, even when the app is not in background nor foreground.

I’m not sure which delegate method of your SDK to use, where I can catch that moment and run the code of UILocalNotification, when the app is killed or suspended. (the didrangebeacon method of ios corebluetooth can meet this requirement, I wonder how is was overridden)

And I can make it work only when app is alive with this code:
func proximityContentManager(proximityContentManager: ProximityContentManager, didUpdateContent content: AnyObject?) { UIApplication.sharedApplication().scheduleLocalNotification(localNotif) }

I know this is tricky, thank for your time!

Sure thing! With Dark to Sleep, the beacon will stop broadcasting its iBeacon packet, and for your app, that’s the same as if the beacon was out of range => AKA the “exit” or “outside” event/state. When Dark to Sleep ends and the iBeacon packet starts being broadcasted again, that’s the same as “enter” or “inside” event/state. And on iOS, you can detect exits/enters even when the app is not running, suspended or killed, with monitoring:

http://developer.estimote.com/ibeacon/tutorial/part-2-background-monitoring/