A trigger condition that causes a notification to be delivered when the user's device enters or exits the specified geographic region.


@interface UNLocationNotificationTrigger : UNNotificationTrigger


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.

Listing 1

Creating a location-based trigger

CLLocationCoordinate2D center = CLLocationCoordinate2DMake(37.335400, -122.009201);

CLCircularRegion* region = [[CLCircularRegion alloc] initWithCenter:center
                 radius:2000.0 identifier:@"Headquarters"];
region.notifyOnEntry = YES;
region.notifyOnExit = NO;

UNLocationNotificationTrigger* trigger = [UNLocationNotificationTrigger
                 triggerWithRegion:region repeats:NO];

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.


Creating a Location Trigger

+ triggerWithRegion:repeats:

Creates a location trigger for the specified region.

Accessing the Trigger Region


The region used to determine when the notification is sent.


See Also



A trigger condition that causes a notification to be delivered at a specific date and time.


A trigger condition that causes a notification to be delivered after the specified amount of time elapses.


A trigger condition that indicates the notification was sent from Apple Push Notification Service (APNs).


The common behavior for subclasses that trigger the delivery of a local or remote notification.