<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "CloudKitJS",
  "identifier" : "/documentation/CloudKitJS/CloudKit.Notification",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "CloudKit JS"
    ],
    "preciseIdentifier" : "cl/CloudKit.Notification"
  },
  "title" : "CloudKit.Notification"
}
-->

# CloudKit.Notification

A [`CloudKit.Notification`](/documentation/CloudKitJS/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`](/documentation/CloudKitJS/CloudKit.Database).

```
interface CloudKit.Notification
```

## Overview

This class is similar to the <doc://com.apple.documentation/documentation/CloudKit/CKNotification> class in the CloudKit framework.

## Topics

### Getting Identifiers

[`readonly attribute String containerIdentifier;`](/documentation/CloudKitJS/CloudKit.Notification/containerIdentifier)

The identifier of the container that generated this notification.

[`readonly attribute String notificationID;`](/documentation/CloudKitJS/CloudKit.Notification/notificationID)

A unique identifier for this notification.

[`readonly attribute String subscriptionID;`](/documentation/CloudKitJS/CloudKit.Notification/subscriptionID)

The identifier for the associated subscription.

[`readonly attribute CloudKit.ZoneID zoneID;`](/documentation/CloudKitJS/CloudKit.Notification/zoneID)

The identifier of the zone that this notification belongs to.

### Getting the Notification Type

[`readonly attribute String notificationType;`](/documentation/CloudKitJS/CloudKit.Notification/notificationType)

The type of notification.

[`readonly attribute Boolean isQueryNotification;`](/documentation/CloudKitJS/CloudKit.Notification/isQueryNotification)

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

[`readonly attribute Boolean isRecordZoneNotification;`](/documentation/CloudKitJS/CloudKit.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

[`readonly attribute String alertActionLocalizationKey;`](/documentation/CloudKitJS/CloudKit.Notification/alertActionLocalizationKey)

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

[`readonly attribute String alertBody;`](/documentation/CloudKitJS/CloudKit.Notification/alertBody)

The text of the alert message.

[`readonly attribute String alertLaunchImage;`](/documentation/CloudKitJS/CloudKit.Notification/alertLaunchImage)

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

[`readonly attribute String[] alertLocalizationArgs;`](/documentation/CloudKitJS/CloudKit.Notification/alertLocalizationArgs)

An array of strings that appear as variables if [`alertLocalizationKey`](/documentation/CloudKitJS/CloudKit.Notification/alertLocalizationKey) is a format specifier.

[`readonly attribute String alertLocalizationKey;`](/documentation/CloudKitJS/CloudKit.Notification/alertLocalizationKey)

A key to a localized alert message.

[`readonly attribute Number badge;`](/documentation/CloudKitJS/CloudKit.Notification/badge)

The badge number to display.

[`readonly attribute String category;`](/documentation/CloudKitJS/CloudKit.Notification/category)

Name of the action group corresponding to this notification.

[`readonly attribute String soundName;`](/documentation/CloudKitJS/CloudKit.Notification/soundName)

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

### Constants

[Notification Types](/documentation/CloudKitJS/notification-types)

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

### Variables

[`const String QUERY_NOTIFICATION_REASON_RECORD_CREATED;`](/documentation/CloudKitJS/CloudKit.Notification/QUERY_NOTIFICATION_REASON_RECORD_CREATED)

A record matching the subscription’s predicate was created.

[`const String QUERY_NOTIFICATION_REASON_RECORD_DELETED;`](/documentation/CloudKitJS/CloudKit.Notification/QUERY_NOTIFICATION_REASON_RECORD_DELETED)

A record matching the subscription’s predicate was deleted.

[`const String QUERY_NOTIFICATION_REASON_RECORD_UPDATED;`](/documentation/CloudKitJS/CloudKit.Notification/QUERY_NOTIFICATION_REASON_RECORD_UPDATED)

A record matching the subscription’s predicate was updated.

## Relationships

### Inherits From

[`CloudKit.QueryNotification`](/documentation/CloudKitJS/CloudKit.QueryNotification)

[`CloudKit.RecordZoneNotification`](/documentation/CloudKitJS/CloudKit.RecordZoneNotification)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)