Inherits from NSObject
Conforms to NSCoding
NSCopying
Declared in PWAlert.h

Overview

A PWAlert object encapsulates all information related to an alert. This includes but is not limited to: the message, the alert ID and the payload dictionary.

Properties

alertID

An NSInteger value that represents the alert ID.

@property (readonly) NSInteger alertID

Declared In

PWAlert.h

message

An NSString value that represents the alert message.

@property (strong, readonly) NSString *message

Declared In

PWAlert.h

payload

An NSDictionary value that represents the payload used to initialize the PWAlert object. You can use this payload to fetch custom arguments.

@property (strong, readonly) NSDictionary *payload

Declared In

PWAlert.h

Instance Methods

initWithNotificationUserInfo:

Initializes a PWAlert object. You can only initialize a PWAlert object with a valid userInfo dictionary.

- (instancetype)initWithNotificationUserInfo:(NSDictionary *)userInfo

Parameters

userInfo

The userInfo that encapsulates the notification. This is fetched from the following locations:

  • application:didReceiveRemoteNotification: passed a userInfo NSDictionary. You can use this dictionary to instantiate a PWAlert object.
  • application:didFinishLaunchingWithOptions: may have a UIApplicationLaunchOptionsRemoteNotificationKey if the application was launched through a push notification. You can extract the userInfo from the launchOptions NSDictionary using the aformentioned key.

Declared In

PWAlert.h