@ -8,6 +8,8 @@ extension PushNotificationAPI {
case accountId = " @ "
case hash = " # "
case namespace = " n "
case createdTimestampMs = " t "
case expirationTimestampMs = " z "
case dataLength = " l "
case dataTooLong = " B "
}
@ -21,6 +23,12 @@ extension PushNotificationAPI {
// / T h e s w a r m n a m e s p a c e i n w h i c h t h i s m e s s a g e a r r i v e d .
let namespace : Int
// / T h e s w a r m t i m e s t a m p w h e n t h e m e s s a g e w a s c r e a t e d ( u n i x e p o c h m i l l i s e c o n d s )
let createdTimestampMs : Int64
// / T h e m e s s a g e ' s s w a r m e x p i r y t i m e s t a m p ( u n i x e p o c h m i l l i s e c o n d s )
let expirationTimestampMs : Int64
// / T h e l e n g t h o f t h e m e s s a g e d a t a . T h i s i s a l w a y s i n c l u d e d , e v e n i f t h e m e s s a g e c o n t e n t
// / i t s e l f w a s t o o l a r g e t o f i t i n t o t h e p u s h n o t i f i c a t i o n .
let dataLength : Int
@ -40,6 +48,8 @@ extension PushNotificationAPI.NotificationMetadata {
accountId : try container . decode ( String . self , forKey : . accountId ) ,
hash : try container . decode ( String . self , forKey : . hash ) ,
namespace : try container . decode ( Int . self , forKey : . namespace ) ,
createdTimestampMs : try container . decode ( Int64 . self , forKey : . createdTimestampMs ) ,
expirationTimestampMs : try container . decode ( Int64 . self , forKey : . expirationTimestampMs ) ,
dataLength : try container . decode ( Int . self , forKey : . dataLength ) ,
dataTooLong : ( ( try ? container . decode ( Int . self , forKey : . dataTooLong ) != 0 ) ? ? false )
)