Class

UNTimeIntervalNotificationTrigger

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

Declaration

@interface UNTimeIntervalNotificationTrigger : UNNotificationTrigger

Overview

Create a UNTimeIntervalNotificationTrigger object when you want to schedule the delivery of a local notification after the specified number of seconds elapse. You use this type of trigger to implement timers.

Listing 1 creates a trigger that delivers its notification one time after thirty minutes have elapsed.

Listing 1

Creating a trigger that fires in 30 minutes

// Fire in 30 minutes (60 seconds times 30)
UNTimeIntervalNotificationTrigger* trigger = [UNTimeIntervalNotificationTrigger
                     triggerWithTimeInterval:(30*60) repeats: NO];

Topics

Creating a Time Interval Trigger

+ triggerWithTimeInterval:repeats:

Creates a time interval trigger from the specified time value.

Getting the Trigger Information

- nextTriggerDate

The next date at which the trigger conditions will be met.

timeInterval

The time interval used to create the trigger.

Relationships

See Also

Triggers

UNCalendarNotificationTrigger

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

UNLocationNotificationTrigger

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

UNPushNotificationTrigger

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

UNNotificationTrigger

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