Instance Property

userInfo

A dictionary of custom information associated with the notification.

Declaration

iOS, Mac Catalyst, watchOS
@property(readonly, copy, nonatomic) NSDictionary *userInfo;
macOS
@property(readonly, copy, atomic) NSDictionary *userInfo;

Discussion

For remote notifications, this property contains the entire notification payload. For local notifications, you configure the property directly before scheduling the notification.

The keys in this dictionary must be property-list types—that is, they must be types that can be serialized into the property-list format. For information about property-list types, see Property List Programming Guide.

See Also

Getting the Notification Data

title

A short description of the reason for the alert.

subtitle

A secondary description of the reason for the alert.

body

The message displayed in the notification alert.

badge

The number to display as the app’s icon badge.

sound

The sound to play when the notification is delivered.

launchImageName

The name of the launch image to display when your app is launched in response to the notification

attachments

An array of attachments to display with the notification.