---
title: UNLocationNotificationTrigger
framework: usernotifications
role: symbol
role_heading: Class
path: usernotifications/unlocationnotificationtrigger
---

# UNLocationNotificationTrigger

A trigger condition that causes the system to deliver a notification when the user’s device enters or exits a geographic region you specify.

## Declaration

```swift
class UNLocationNotificationTrigger
```

## Overview

Overview 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 it schedules at the same time. important: Before scheduling any notifications using this trigger, your app must have authorization to use Core Location and must have when-in-use permissions. (Because the system actually monitors the regions, you don’t need to request always permissions for your app). For information about how to request authorization, see Requesting authorization to use location services. When configuring the region, use the notifyOnEntry and notifyOnExit properties to specify whether you want the system to deliver notifications 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 The system doesn’t immediately trigger region-based notifications when the edge of the boundary is crossed. The system applies heuristics to ensure that the boundary crossing represents a deliberate event and isn’t the result of spurious location data. For more information about the heuristics, see Monitoring the user’s proximity to geographic regions.

## Topics

### Creating a Location Trigger

- [init(region:repeats:)](usernotifications/unlocationnotificationtrigger/init(region:repeats:).md)

### Accessing the Trigger Region

- [region](usernotifications/unlocationnotificationtrigger/region.md)

## Relationships

### Inherits From

- [UNNotificationTrigger](usernotifications/unnotificationtrigger.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)

## See Also

### Triggers

- [UNCalendarNotificationTrigger](usernotifications/uncalendarnotificationtrigger.md)
- [UNTimeIntervalNotificationTrigger](usernotifications/untimeintervalnotificationtrigger.md)
- [UNPushNotificationTrigger](usernotifications/unpushnotificationtrigger.md)
- [UNNotificationTrigger](usernotifications/unnotificationtrigger.md)
