<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CloudKit",
  "identifier" : "/documentation/CloudKit/CKSubscription/NotificationInfo-swift.class/init(alertBody:alertLocalizationKey:alertLocalizationArgs:title:titleLocalizationKey:titleLocalizationArgs:subtitle:subtitleLocalizationKey:subtitleLocalizationArgs:alertActionLocalizationKey:alertLaunchImage:soundName:desiredKeys:shouldBadge:shouldSendContentAvailable:shouldSendMutableContent:category:collapseIDKey:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "CloudKit"
    ],
    "preciseIdentifier" : "s:So18CKNotificationInfoC8CloudKitE9alertBody0E15LocalizationKey0eG4Args5title0jgH00jgI08subtitle0kgH00kgI00e6ActiongH00E11LaunchImage9soundName11desiredKeys11shouldBadge0S20SendContentAvailable0su7MutableV08category13collapseIDKeyABSSSg_AVSaySSGA2vw2vw3vWS3bA2Vtcfc"
  },
  "title" : "init(alertBody:alertLocalizationKey:alertLocalizationArgs:title:titleLocalizationKey:titleLocalizationArgs:subtitle:subtitleLocalizationKey:subtitleLocalizationArgs:alertActionLocalizationKey:alertLaunchImage:soundName:desiredKeys:shouldBadge:shouldSendContentAvailable:shouldSendMutableContent:category:collapseIDKey:)"
}
-->

# init(alertBody:alertLocalizationKey:alertLocalizationArgs:title:titleLocalizationKey:titleLocalizationArgs:subtitle:subtitleLocalizationKey:subtitleLocalizationArgs:alertActionLocalizationKey:alertLaunchImage:soundName:desiredKeys:shouldBadge:shouldSendContentAvailable:shouldSendMutableContent:category:collapseIDKey:)

Creates a notification with the specified values.

```
convenience init(alertBody: String? = nil, alertLocalizationKey: String? = nil, alertLocalizationArgs: [CKRecord.FieldKey] = [], title: String? = nil, titleLocalizationKey: String? = nil, titleLocalizationArgs: [CKRecord.FieldKey] = [], subtitle: String? = nil, subtitleLocalizationKey: String? = nil, subtitleLocalizationArgs: [CKRecord.FieldKey] = [], alertActionLocalizationKey: String? = nil, alertLaunchImage: String? = nil, soundName: String? = nil, desiredKeys: [CKRecord.FieldKey] = [], shouldBadge: Bool = false, shouldSendContentAvailable: Bool = false, shouldSendMutableContent: Bool = false, category: String? = nil, collapseIDKey: String? = nil)
```

## Parameters

`alertBody`

The text for the notification’s alert.

`alertLocalizationKey`

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

`alertLocalizationArgs`

The fields for building a notification’s alert.

`title`

The notification’s title.

`titleLocalizationKey`

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

`titleLocalizationArgs`

The fields for building a notification’s title.

`subtitle`

The notification’s subtitle.

`subtitleLocalizationKey`

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

`subtitleLocalizationArgs`

The fields for building a notification’s subtitle.

`alertActionLocalizationKey`

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

`alertLaunchImage`

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

`soundName`

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

`desiredKeys`

The names of fields to include in the push notification’s payload.

`shouldBadge`

A Boolean value that determines whether an app’s icon badge increments its value.

`shouldSendContentAvailable`

A Boolean value that indicates whether the push notification includes the content available flag.

`shouldSendMutableContent`

A Boolean value that indicates whether the push notification includes the content available flag.

`category`

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

`collapseIDKey`

The value that the system uses to coalesce unseen push notifications.

## Discussion

See the corresponding properties for more details about each parameter.

---

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)