<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CloudKit",
  "identifier" : "/documentation/CloudKit/CKNotification",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "CloudKit"
    ],
    "preciseIdentifier" : "c:objc(cs)CKNotification"
  },
  "title" : "CKNotification"
}
-->

# CKNotification

The abstract base class for CloudKit notifications.

```
class CKNotification
```

## Overview

Use subclasses of `CKNotification` to extract data from push notifications that the system receives, or to fetch a container’s previous push notifications. In both cases, the object indicates the changed data.

`CKNotification` is an abstract class. When you create a notification from a payload dictionary, the [`init(fromRemoteNotificationDictionary:)`](/documentation/CloudKit/CKNotification/init(fromRemoteNotificationDictionary:)) method returns an instance of the appropriate subclass. Similarly, when you fetch notifications from a container, you receive instances of a concrete subclass. `CKNotification` provides information about the push notification and its method of delivery. Subclasses contain specific data that provides the changes.

The system delivers notifications with alerts, badges, or sounds via the `UserNotifications` framework, in the form of a `UNNotification`.

Applications should use the `UserNotifications` framework to interact with the alert, badge, and sound properties of the notification.

Applications may create a [`CKNotification`](/documentation/CloudKit/CKNotification) from a `UNNotification` in their `UNUserNotificationCenterDelegate`:

```swift
 func userNotificationCenter(
     _ center: UNUserNotificationCenter, willPresent notification: UNNotification
 ) async -> UNNotificationPresentationOptions {
    let ckNotification = CKNotification(fromRemoteNotificationDictionary: notification.request.content.userInfo)
}
```

Notifications without alerts, badges, or sounds are delivered via an application delegate, in the form of a remote notification.

For example: `UIApplicationDelegate.application(_:didReceiveRemoteNotification:) async`

Applications may create a [`CKNotification`](/documentation/CloudKit/CKNotification) from the remote notification in their `UIApplicationDelegate`:

```swift
func application(
    _ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]
) async -> UIBackgroundFetchResult {
    let ckNotification = CKNotification(fromRemoteNotificationDictionary: userInfo)
}
```

## Topics

### Creating a Notification

[`init(fromRemoteNotificationDictionary:)`](/documentation/CloudKit/CKNotification/init(fromRemoteNotificationDictionary:))

Creates a new notification using the specified payload data.

### Identifying the Notification

[`notificationID`](/documentation/CloudKit/CKNotification/notificationID)

The notification’s ID.

[`CKNotification.ID`](/documentation/CloudKit/CKNotification/ID)

An object that uniquely identifies a push notification that a container sends.

[`notificationType`](/documentation/CloudKit/CKNotification/notificationType-swift.property)

The type of event that generates the notification.

[`CKNotification.NotificationType`](/documentation/CloudKit/CKNotification/NotificationType-swift.enum)

Constants that indicate the type of event that generates the push notification.

[`containerIdentifier`](/documentation/CloudKit/CKNotification/containerIdentifier)

The ID of the container with the content that triggers the notification.

### Getting the Notification’s Status

[`isPruned`](/documentation/CloudKit/CKNotification/isPruned)

A Boolean value that indicates whether the system removes some push notification content before delivery.

### Accessing the Notification Info

[`alertBody`](/documentation/CloudKit/CKNotification/alertBody)

The notification’s alert body.

[`alertLocalizationKey`](/documentation/CloudKit/CKNotification/alertLocalizationKey)

The key that identifies the localized text for the alert body.

[`alertLocalizationArgs`](/documentation/CloudKit/CKNotification/alertLocalizationArgs)

The fields for building a notification’s alert.

[`alertActionLocalizationKey`](/documentation/CloudKit/CKNotification/alertActionLocalizationKey)

The key that identifies the localized string for the notification’s action.

[`alertLaunchImage`](/documentation/CloudKit/CKNotification/alertLaunchImage)

The filename of an image to use as a launch image.

[`soundName`](/documentation/CloudKit/CKNotification/soundName)

The name of the sound file to play when a notification arrives.

[`badge`](/documentation/CloudKit/CKNotification/badge)

The value that the app icon’s badge displays.

[`category`](/documentation/CloudKit/CKNotification/category)

The name of the action group that corresponds to this notification.

[`subscriptionID`](/documentation/CloudKit/CKNotification/subscriptionID-16ygj)

The ID of the subscription that triggers the notification.

[`subscriptionID`](/documentation/CloudKit/CKNotification/subscriptionID-90zhj)

The ID of the subscription that triggers the notification.

[`subscriptionOwnerUserRecordID`](/documentation/CloudKit/CKNotification/subscriptionOwnerUserRecordID)

The ID of the user record that creates the subscription that generates the push notification.

[`title`](/documentation/CloudKit/CKNotification/title)

The notification’s title.

[`titleLocalizationKey`](/documentation/CloudKit/CKNotification/titleLocalizationKey)

The key that identifies the localized string for the notification’s title.

[`titleLocalizationArgs`](/documentation/CloudKit/CKNotification/titleLocalizationArgs)

The fields for building a notification’s title.

[`subtitle`](/documentation/CloudKit/CKNotification/subtitle)

The notification’s subtitle.

[`subtitleLocalizationKey`](/documentation/CloudKit/CKNotification/subtitleLocalizationKey)

The key that identifies the localized string for the notification’s subtitle.

[`subtitleLocalizationArgs`](/documentation/CloudKit/CKNotification/subtitleLocalizationArgs)

The fields for building a notification’s subtitle.



---

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)