Location services can deliver Notifications to your app even when the apps are not running !!! Region-monitoring can relaunch the app, but we need to allow “Background App refresh” setting (iOS 7 only).
From Apple’s doc
So from theoretical point, the app can be relaunched using geofencing, even when it has been forced-quit. However, the limit is the app can only monitor 20 regions at a time.
In iOS, regions associated with your app are tracked at all times, including when the app isn’t running. If a region boundary is crossed while an app isn’t running, that app is relaunched into the background to handle the event. Similarly, if the app is suspended when the event occurs, it’s woken up and given a short amount of time (around 10 seconds) to handle the event. When necessary, an app can request more background execution time using the
beginBackgroundTaskWithExpirationHandler:method of the
locationManager:didEnterRegion:and locationManager:didExitRegion: (you can specify by explicitly setting the
notifyOnExitproperties of the
CLRegionclass when you define and register a region.)
This enter/exit feature (also still to come on BlueDot technology) is done by Apple with a cushion distance, to avoid the system generating consecutive entry/exit events when the user is at the boundary of a region.
NOTE: Apparently, the iOS 8 does not allow Background App Refresh to affect the Location Service anymore. Setting the Background App Refresh to OFF only stop apps in iOS7 from accessing Location data, but not iOS 8 app. (Apple Discussion)
You define a beacon region with the appropriate initialization method of the
CLBeaconRegionclass. When you create a
CLBeaconRegionobject, you specify the
minorproperties of the beacons you want to monitor (the proximity UUID is required; the major and minor values are optional).
We can turn our iPhone into iBeacon for testing purposes, however apps need to be foreground for this test.