Message
class Message implements Serializable
An APNS Message representation.
Note: All strings given to this class must be in UTF-8 to create a valid message
Methods
Get a builder to constuct a message
Construct Message
Check if this message is short enough to be send to iOS 7 or OS X Note: iOS 8 support messages up to 2048 bytes, OS X and iOS 7 and below support messages up to 256 bytes
Get the device token of the receiving device
Get the certificate that should be used for this message
Get the moment this message expires
Get the current alert
Get the value of the badge as set in this message
Get the sound that will be played when this message is received
Get the category identifier that will be used to determine custom actions
Get newsstand content availability flag that will trigger the newsstand item to download new content
Get the current payload
Get the JSON payload that should be send to the APNS
String representation of object
Constructs the object from serialized data
Get a string representation of this object
Details
at line 29
static MessageBuilder
builder()
Get a builder to constuct a message
at line 49
__construct(string $deviceToken, Certificate $certificate, array|null $alert, int|null $badge, string|null $sound, array|json|null $payload, string $category, boolean $contentAvailable, DateTime $expiresAt = null)
Construct Message
at line 76
boolean
isCompatibleWithSmallPayloadSize()
Check if this message is short enough to be send to iOS 7 or OS X Note: iOS 8 support messages up to 2048 bytes, OS X and iOS 7 and below support messages up to 256 bytes
at line 86
string
getDeviceToken()
Get the device token of the receiving device
at line 96
Certificate
getCertificate()
Get the certificate that should be used for this message
at line 106
int
getExpiresAt()
Get the moment this message expires
at line 116
string|array
getAlert()
Get the current alert
at line 126
int|null
getBadge()
Get the value of the badge as set in this message
at line 136
string|null
getSound()
Get the sound that will be played when this message is received
at line 146
string|null
getCategory()
Get the category identifier that will be used to determine custom actions
at line 156
boolean
getContentAvailable()
Get newsstand content availability flag that will trigger the newsstand item to download new content
at line 166
array|null
getPayload()
Get the current payload
at line 177
string
getJson()
Get the JSON payload that should be send to the APNS
at line 232
string
serialize()
String representation of object
at line 249
unserialize(string $serialized)
Constructs the object from serialized data
at line 266
string
__toString()
Get a string representation of this object