APN
public class APN
Representation of a server push notification that is used to parse the notification’s payload, category and type.
-
Type of the server push notification. See
UsherSessionType
. This value should be defined at initialization.Declaration
Swift
public let type: UsherSessionType
-
Category of the server push notification. See
APNCategory
Declaration
Swift
public var category: APNCategory
-
Payload of the server push notification.
Declaration
Swift
public let payload: APNPayload
-
Specifies if a UNNotificationAction, as defined by the category, has already been performed on the notification.
Declaration
Swift
public var actionPerformed: Bool
-
The UNNotification object associated with this APN.
Declaration
Swift
public var notification: UNNotification?
-
Identifier of the notification associated with this APN. If the is no notification object associated with this APN, it is assumed that it is a silent notification and the identifier will be of the format
silent-notification-{UsherSessionType.rawValue}
Declaration
Swift
public var identifier: String { get }
-
Initializes the APN class.
Declaration
Swift
public init(type: UsherSessionType, category: APNCategory?, payload: APNPayload)
Parameters
type
the server notification session type
category
the server notification category
payload
the server notification payload
-
Initializes the APN class with the UNNotification userInfo dictionary
Declaration
Swift
public convenience init(with userInfo: [AnyHashable : Any])
Parameters
userInfo
UNNotification userInfo dictionary (aka UNNotification.request.content.userInfo)
-
Initializes the APN class with UNNotification
Declaration
Swift
public convenience init(userNotification: UNNotification)
Parameters
userNotification
UNNotification instance
-
Initializes the APN class with UNNotificationResponse
Declaration
Swift
public convenience init(response: UNNotificationResponse)
Parameters
response
UNNotificationResponse instance