PWAlert Class Reference
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
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 userInfoNSDictionary
. You can use this dictionary to instantiate aPWAlert
object.application:didFinishLaunchingWithOptions:
may have aUIApplicationLaunchOptionsRemoteNotificationKey
if the application was launched through a push notification. You can extract the userInfo from the launchOptionsNSDictionary
using the aformentioned key.
Declared In
PWAlert.h