A trigger condition that causes a notification to be delivered when the user's device enters or exits the specified geographic region.
Create a UNLocationNotificationTrigger object when you want to schedule the delivery of a local notification when the device enters or leaves a specific geographic region. The system limits the number of location-based triggers that may be scheduled at the same time.
When configuring the region, use the notifyOnEntry and notifyOnExit properties to specify whether you want notifications to be delivered on entry, on exit, or both. Listing 1 shows the creation of a trigger that fires only once when the user’s device enters a circular region with a 2-kilometer radius.
Region-based notifications aren't always triggered immediately when the edge of the boundary is crossed. The system applies heuristics to ensure that the boundary crossing represents a deliberate event and is not the result of spurious location data. For more information about the heuristics that are applied, see Monitoring the User's Proximity to Geographic Regions.