PHP Класс RMS\PushNotificationsBundle\Service\OS\AppleNotification

Наследование: implements RMS\PushNotificationsBundle\Service\OS\OSNotificationServiceInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$apnStreams array Array for streams to APN
$cachedir string Cache dir used for cache pem file
$jsonUnescapedUnicode boolean JSON_UNESCAPED_UNICODE
$lastMessageId integer Last used message ID
$logger Psr\Log\LoggerInterface Monolog logger
$messages array Array for messages to APN
$passphrase string Passphrase for PEM file
$pemContent string Content of PEM
$pemContentPassphrase string Passphrase for PEM content
$pemPath string Path to PEM file
$responses array Collection of the responses from the APN
$timeout integer Connection timeout
$useSandbox boolean Whether or not to use the sandbox APNS

Открытые методы

Метод Описание
__construct ( boolean $sandbox, string $pem, string $passphrase = "", boolean $jsonUnescapedUnicode = FALSE, integer $timeout = 60, string $cachedir = "", RMS\PushNotificationsBundle\Service\EventListener $eventListener = null, Psr\Log\LoggerInterface $logger = null ) Constructor
createMdmPayload ( string $token, string $magicPushToken ) : string Creates a MDM payload
getResponses ( ) : array Returns responses
onKernelTerminate ( ) Called on kernel terminate
send ( RMS\PushNotificationsBundle\Message\MessageInterface $message ) : boolean Send a MDM or notification message
setJsonUnescapedUnicode ( boolean $jsonUnescapedUnicode ) Set option JSON_UNESCAPED_UNICODE to json encoders
setPemAsString ( $pemContent, $passphrase )

Защищенные методы

Метод Описание
closeApnStream ( string $apnURL ) Close the apn stream associated with the given apn URL
createPayload ( integer $messageId, string $expiry, string $token, array $message ) : string Creates the full payload for the notification
getApnStream ( string $apnURL ) : resource Get an apn stream associated with the given apn URL, create one if necessary
getStreamContext ( ) : resource Gets a stream context set up for SSL using our PEM file and passphrase
sendMessages ( integer $firstMessageId, string $apnURL ) : integer Send all notification messages starting from the given ID
writeApnStream ( string $apnURL, string $payload ) : mixed Write data to the apn stream that is associated with the given apn URL

Приватные методы

Метод Описание
closeStreams ( ) Close existing streams
removeCachedPemFile ( ) Remove cache pem file

Описание методов

__construct() публичный Метод

Constructor
public __construct ( boolean $sandbox, string $pem, string $passphrase = "", boolean $jsonUnescapedUnicode = FALSE, integer $timeout = 60, string $cachedir = "", RMS\PushNotificationsBundle\Service\EventListener $eventListener = null, Psr\Log\LoggerInterface $logger = null )
$sandbox boolean
$pem string
$passphrase string
$jsonUnescapedUnicode boolean
$timeout integer
$cachedir string
$eventListener RMS\PushNotificationsBundle\Service\EventListener
$logger Psr\Log\LoggerInterface

closeApnStream() защищенный Метод

Close the apn stream associated with the given apn URL
protected closeApnStream ( string $apnURL )
$apnURL string

createMdmPayload() публичный Метод

Creates a MDM payload
public createMdmPayload ( string $token, string $magicPushToken ) : string
$token string
$magicPushToken string
Результат string

createPayload() защищенный Метод

Creates the full payload for the notification
protected createPayload ( integer $messageId, string $expiry, string $token, array $message ) : string
$messageId integer
$expiry string
$token string
$message array
Результат string

getApnStream() защищенный Метод

Get an apn stream associated with the given apn URL, create one if necessary
protected getApnStream ( string $apnURL ) : resource
$apnURL string
Результат resource

getResponses() публичный Метод

Returns responses
public getResponses ( ) : array
Результат array

getStreamContext() защищенный Метод

Gets a stream context set up for SSL using our PEM file and passphrase
protected getStreamContext ( ) : resource
Результат resource

onKernelTerminate() публичный Метод

Called on kernel terminate
public onKernelTerminate ( )

send() публичный Метод

Send a MDM or notification message
public send ( RMS\PushNotificationsBundle\Message\MessageInterface $message ) : boolean
$message RMS\PushNotificationsBundle\Message\MessageInterface
Результат boolean

sendMessages() защищенный Метод

Send all notification messages starting from the given ID
protected sendMessages ( integer $firstMessageId, string $apnURL ) : integer
$firstMessageId integer
$apnURL string
Результат integer

setJsonUnescapedUnicode() публичный Метод

Set option JSON_UNESCAPED_UNICODE to json encoders
public setJsonUnescapedUnicode ( boolean $jsonUnescapedUnicode )
$jsonUnescapedUnicode boolean

setPemAsString() публичный Метод

public setPemAsString ( $pemContent, $passphrase )
$pemContent
$passphrase

writeApnStream() защищенный Метод

Write data to the apn stream that is associated with the given apn URL
protected writeApnStream ( string $apnURL, string $payload ) : mixed
$apnURL string
$payload string
Результат mixed

Описание свойств

$apnStreams защищенное свойство

Array for streams to APN
protected array $apnStreams
Результат array

$cachedir защищенное свойство

Cache dir used for cache pem file
protected string $cachedir
Результат string

$jsonUnescapedUnicode защищенное свойство

JSON_UNESCAPED_UNICODE
protected bool $jsonUnescapedUnicode
Результат boolean

$lastMessageId защищенное свойство

Last used message ID
protected int $lastMessageId
Результат integer

$logger защищенное свойство

Monolog logger
protected LoggerInterface,Psr\Log $logger
Результат Psr\Log\LoggerInterface

$messages защищенное свойство

Array for messages to APN
protected array $messages
Результат array

$passphrase защищенное свойство

Passphrase for PEM file
protected string $passphrase
Результат string

$pemContent защищенное свойство

Content of PEM
protected string $pemContent
Результат string

$pemContentPassphrase защищенное свойство

Passphrase for PEM content
protected string $pemContentPassphrase
Результат string

$pemPath защищенное свойство

Path to PEM file
protected string $pemPath
Результат string

$responses защищенное свойство

Collection of the responses from the APN
protected array $responses
Результат array

$timeout защищенное свойство

Connection timeout
protected int $timeout
Результат integer

$useSandbox защищенное свойство

Whether or not to use the sandbox APNS
protected bool $useSandbox
Результат boolean