UANotificationResponse
@interface UANotificationResponse : NSObject
iOS version-independent wrapper for UNNotificationResponse. Contains the user’s reponse to a notification.
-
Action identifier for the response.
Declaration
Objective-C
@property (readonly, copy, nonatomic) NSString *_Nonnull actionIdentifier;
Swift
var actionIdentifier: String { get }
-
String populated with any response text provided by the user.
Declaration
Objective-C
@property (readonly, copy, nonatomic) NSString *_Nonnull responseText;
Swift
var responseText: String { get }
-
The UANotificationContent instance associated with the response.
Declaration
Objective-C
@property (readonly, strong, nonatomic) UANotificationContent *_Nonnull notificationContent;
Swift
var notificationContent: UANotificationContent { get }
-
The UNNotificationResponse that generated the UANotificationResponse.
Declaration
Objective-C
@property (readonly, strong, nonatomic, nullable) UNNotificationResponse *response;
Swift
var response: UNNotificationResponse? { get }
-
UANotificationResponse factory method.
Declaration
Objective-C
+ (nonnull instancetype) notificationResponseWithNotificationInfo: (nonnull NSDictionary *)notificationInfo actionIdentifier: (nonnull NSString *)actionIdentifier responseText:(nullable NSString *)responseText;
Swift
convenience init(notificationInfo: [AnyHashable : Any], actionIdentifier: String, responseText: String?)
Parameters
notificationInfo
The notification user info.
actionIdentifier
The notification action ID.
responseText
Optional response text.
Return Value
A UANotificationResponse instance.
-
UANotificationResponse factory method.
Declaration
Objective-C
+ (nonnull instancetype)notificationResponseWithUNNotificationResponse: (nonnull UNNotificationResponse *)response;
Swift
convenience init(unNotificationResponse response: UNNotificationResponse)
Parameters
response
The UNNotificationResponse.
Return Value
A UANotificationResponse instance.