App Local Notification

I've received the Estimote Beacons and I've been doing some tests with the Notification Demo App that is in GitHub. I don't know if it's just with me, but the local notifications aren't showing up all the time. It appears sometimes, not all, when the app is exited, but still open. When the app is closed it never appears, even with the background activity ON. I've noticed also that the local notification only appears for the "didEnterRegion" delegate method, but for the "didExitRegion" it's not working.

Hi guys,

@Ricardo: that's an excellent answer, thanks for that!

@Bruno: as Ricardo mentioned, you need an app to actually run at least in the background for it to keep monitoring for the Beacons. If it's killed entirely, then your phone will treat Beacon's signal as a background radio noise. Also, keep in mind that Apple frameworks for Bluetooth and Beacons work in such a way that when you leave the region, there is a 30 second delay before receiving the notification.

A few things are not clearly explained about how CLLocation deals with beacons.
Firstly, it's important to clearly define what "open" and "exited" means to an app state. An app cannot be exited but still open. While "open" (running), it can have two states: foreground or background. Foreground means it is showing its UI to the user. Background means it is "minimized" and can be seen within the other apps that you have at iOS' task switcher.

If your app is running in any state (foreground/background), your enterRegion and exitRegion methods will be called, so you can perform what you need to do.

If your app is not running (exited!), nothing will happen, simply because the app is not running and beacons around your phone are not scanned.

Triggering didEnterRegion and didExitRegion can be a bit tricky process and requires you some time to get used to how iOS handles iBeacons. For example, if you want to manually force your app to trigger didExitRegion, you can put the beacon inside a microwave over (but do not turn the oven on!), wait for 15 seconds or a bit more and your exit method must/should be called. If it is not being triggered, you have to make sure that your Estimote is totally isolated and cannot be reached by your phone.

In simple words, didEnterRegion and didExitRegion are called when iOS wants, not your app or the user.

You're perfectly right on that. Apple's decision to limit/remove features, such as iOS6 startMonitoringSignificantLocationChanges, which allowed apps to wake up when a region was found, somehow take 50% of the fun users, businesses and developers can have with the iBeacon technology. I really hope they address this limitation in the near future.

But also think that the example you mentioned (call for attention) is just one of the applications which beacons can be used - It would not be a problem for a museum, supermarket or amusement park app, as long as the users know it can be used and what "benefits" they will have if they keep the app running.

Ok so can you confirm that this is untrue (in your getting started documentation):

Geofencing

Now is the magic part. Apps can subscribe in the operating system (both iOS and Android) to constantly listen for particular identifiers. When the phone comes into the range of a beacon, the app is notified about this, even if the phone is locked or the app is not currently running.

Thank you two for the answers, I think it's clear to me now. But, considering what you said, I think that all that idea shown on videos, where the users walk near by a store and a notification appears on his phone, can be a little bit difficult to achieve. You have to remember the user to AT LEAST keep the app running on background. On the other hand, the idea of beacons (as put on the store scenario video) is exactly to CALL THE USER'S ATTENTION by sending a notification. Well, if the user remembered to let the app running when approaching the store I think he doesn't need to be called, because he is already going there. Do you get my point?

I do understand your point, but please consider that our aim is to enhance the customer's experience. Offer him a better deal. Remove the friction. Make his life easier. It's not only a marketing technology, really :)

And another thing is that, as Ricardo mentioned, Beacons are not limited to retail and shopping. Public transport, museums, airports, hospitals - the only limit here is your imagination.