class Notificato implements LoggerAwareInterface

Methods

__construct(string|null $pemFile = null, string|null $passphrase = null, boolean $validate = true, string|null $endpointEnv = null)

Notificato constructor

createCertificate(string $pemFile, string|null $passphrase = null, boolean $validate = true, string|null $endpointEnv = null)

Create an APNS Certificate

messageBuilder()

Create a Message builder

queue(Message $message)

Queue a message on the correct APNS gateway connection

flush(Certificate $certificate = null)

Send all queued messages

send(Message $message)

Queues a message and flushes the gateway connection it must be send over immediately Note: If you send multiple messages, queue as many as possible and flush them at once for maximum performance

array
receiveFeedback(Certificate $certificate = null)

Receive the feedback tuples from APNS

setSender(Sender $sender)

Sets the sender to use.

setLogger(LoggerInterface $logger)

Sets a logger instance on the object.

setCertificateFactory(CertificateFactory $certificateFactory)

Sets the certificate factory to use.

setFeedbackFactory(FeedbackFactory $feedbackFactory)

Sets the feedback factory to use.

Details

at line 28
__construct(string|null $pemFile = null, string|null $passphrase = null, boolean $validate = true, string|null $endpointEnv = null)

Notificato constructor

Parameters

string|null $pemFile Path to the PEM certificate file to use as default certificate, null for no default certificate
string|null $passphrase Passphrase to use with the PEM file
boolean $validate Set to false to skip the validation of the certificate, default true
string|null $endpointEnv APNS environment this certificate is valid for, by default autodetects during validation

at line 46
Certificate createCertificate(string $pemFile, string|null $passphrase = null, boolean $validate = true, string|null $endpointEnv = null)

Create an APNS Certificate

Parameters

string $pemFile Path to the PEM certificate file
string|null $passphrase Passphrase to use with the PEM file
boolean $validate Set to false to skip the validation of the certificate, default true
string|null $endpointEnv APNS environment this certificate is valid for, by default autodetects during validation

Return Value

Certificate

at line 56
MessageBuilder messageBuilder()

Create a Message builder

Return Value

MessageBuilder

at line 73
MessageEnvelope queue(Message $message)

Queue a message on the correct APNS gateway connection

Parameters

Message $message The message to queue

Return Value

MessageEnvelope

at line 83
flush(Certificate $certificate = null)

Send all queued messages

Parameters

Certificate $certificate When given only the gateway connection for the given certificate is flushed

at line 95
MessageEnvelope send(Message $message)

Queues a message and flushes the gateway connection it must be send over immediately Note: If you send multiple messages, queue as many as possible and flush them at once for maximum performance

Parameters

Message $message The message to send

Return Value

MessageEnvelope

at line 106
array receiveFeedback(Certificate $certificate = null)

Receive the feedback tuples from APNS

Parameters

Certificate $certificate The certificate to use to connect to APNS, default use the default certificate

Return Value

array Array containing FeedbackTuples received from Apple

at line 120
setSender(Sender $sender)

Sets the sender to use.

Note: The given sender will get the logger used by this Notificato object

Parameters

Sender $sender

at line 132
setLogger(LoggerInterface $logger)

Sets a logger instance on the object.

Note: The sender is automaticly updated with this logger

Parameters

LoggerInterface $logger

at line 149
setCertificateFactory(CertificateFactory $certificateFactory)

Sets the certificate factory to use.

Note: If you set a certificate factory you are responsible for setting the correct default certificate. Note: The FeedbackFactory and MessageFactory are automaticly updated with the given CertificateFactory.

Parameters

CertificateFactory $certificateFactory

at line 165
setFeedbackFactory(FeedbackFactory $feedbackFactory)

Sets the feedback factory to use.

Note: The certificate factory is automaticly set to the factory used by this Notificato object

Parameters

FeedbackFactory $feedbackFactory