Class

CloudKit.Notification

A CloudKit.Notification object represents a push notification that was sent to your app. Notifications are triggered by subscriptions that you save to the database. To subscribe to record changes and handle push notifications, see the saveSubscription method in CloudKit.Database.

Declaration

interface CloudKit.Notification

Overview

This class is similar to the CKNotification class in the CloudKit framework.

Topics

Getting Identifiers

containerIdentifier

The identifier of the container that generated this notification.

notificationID

A unique identifier for this notification.

subscriptionID

The identifier for the associated subscription.

zoneID

The identifier of the zone that this notification belongs to.

Getting the Notification Type

notificationType

The type of notification.

isQueryNotification

A Boolean value indicating whether this push notification is a query notification.

isRecordZoneNotification

A Boolean value indicating whether this notification is a push notification that was sent because of changes to a record zone.

Presenting Notifications

alertActionLocalizationKey

A key to get a localized right button title that appears in the alert dialog.

alertBody

The text of the alert message.

alertLaunchImage

The filename of an image file in the app bundle used as a launch image.

alertLocalizationArgs

An array of strings that appear as variables if alertLocalizationKey is a format specifier.

alertLocalizationKey

A key to a localized alert message.

badge

The badge number to display.

category

Name of the action group corresponding to this notification.

soundName

The name of a sound file in the app bundle to play as an alert.

Constants

Notification Types

Constants indicating the type of event that generated the push notification.