class MessageEnvelope

Constants

STATUS_NOTSEND

Statuscode: Message not (yet) send to APNS

STATUS_NOERRORS

Statuscode: Message send, no errors encountered so far

STATUS_SENDFAILED

Statuscode: Sending message failed, will retry with other envelope

STATUS_EARLIERERROR

Statuscode: Failed to send message due earlier error, will retry with other envelope

BINARY_COMMAND

Binary command to send a message to the APNS gateway (Internal use)

BINARY_DEVICETOKEN_SIZE

Binary size of a device token (Internal use)

Methods

__construct(int $identifier, Message $message)

Construct MessageEnvelope

int
getIdentifier()

Unique number to the relevant APNS connection to identify this message

getMessage()

The message that's is contained by this envelope

getRetryEnvelope()

Get the envelope used for the retry

setStatus(int $status, MessageEnvelope|null $envelope = null)

Set the status of this message envelope only possible if there is no final state set yet.

int
getStatus()

Get the current status of this message envelope

string
getStatusDescription()

Get a description of the current status of this message envelope

int
getFinalStatus()

Get the final status after all retries.

string
getFinalStatusDescription()

Get a description of the final status after all retries.

string
getBinaryMessage()

Get the message that this envelope contains in binary APNS compatible format

Details

at line 71
__construct(int $identifier, Message $message)

Construct MessageEnvelope

Parameters

int $identifier Unique number to the relevant APNS connection to identify this message
Message $message The message that's is contained by this envelope

at line 95
int getIdentifier()

Unique number to the relevant APNS connection to identify this message

Return Value

int

at line 105
Message getMessage()

The message that's is contained by this envelope

Return Value

Message

at line 115
MessageEnvelope getRetryEnvelope()

Get the envelope used for the retry

Return Value

MessageEnvelope

at line 127
setStatus(int $status, MessageEnvelope|null $envelope = null)

Set the status of this message envelope only possible if there is no final state set yet.

Parameters

int $status One of the keys in self::$statusDescriptionMapping
MessageEnvelope|null $envelope Envelope for the retry of this MessageEnvelope

at line 154
int getStatus()

Get the current status of this message envelope

Return Value

int

at line 164
string getStatusDescription()

Get a description of the current status of this message envelope

Return Value

string

at line 175
int getFinalStatus()

Get the final status after all retries.

Use this method to know how the message ended up after all retries.

Return Value

int

at line 191
string getFinalStatusDescription()

Get a description of the final status after all retries.

Use this method to know how the message ended up after all retries.

Return Value

string

at line 201
string getBinaryMessage()

Get the message that this envelope contains in binary APNS compatible format

Return Value

string