Instance Property

userInfo

A dictionary of custom information associated with the notification.

Declaration

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

Discussion

Use this property to associate custom information with the notification. The contents of the dictionary are not seen by the user, but are accessible to your app or to any notification-related app extensions.

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

The localized title, containing the reason for the alert.

subtitle

The localized subtitle, containing a secondary description of the reason for the alert.

body

The localized message to display in the notification alert.

badge

The number to apply to the app’s icon.

sound

The sound to play when the notification is delivered.

launchImageName

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

attachments

An array of attachments to display in an alert-based notification.