apns-php
|
The Feedback Service client. More...
Public Member Functions | |
array | receive () |
Receives feedback tuples from Apple Push Notification Service feedback. More... | |
Public Member Functions inherited from ApnsPHP_Abstract | |
void | __construct (integer $nEnvironment, string $sProviderCertificateFile) |
Constructor. More... | |
void | connect () |
Connects to Apple Push Notification service server. More... | |
boolean | disconnect () |
Disconnects from Apple Push Notifications service server. More... | |
string | getCertificateAuthority () |
Get the Root Certification Authority file path. More... | |
integer | getConnectRetryInterval () |
Get the connect retry interval. More... | |
integer | getConnectRetryTimes () |
Get the connect retry time value. More... | |
integer | getConnectTimeout () |
Get the connection timeout. More... | |
ApnsPHP_Log_Interface | getLogger () |
Get the Logger instance. More... | |
integer | getSocketSelectTimeout () |
Get the TCP socket select timeout. More... | |
integer | getWriteInterval () |
Get the write interval. More... | |
void | setConnectRetryInterval (integer $nRetryInterval) |
Set the connect retry interval. More... | |
void | setConnectRetryTimes (integer $nRetryTimes) |
Set the connect retry times value. More... | |
void | setConnectTimeout (integer $nTimeout) |
Set the connection timeout. More... | |
void | setLogger (ApnsPHP_Log_Interface $logger) |
Set the Logger instance to use for logging purpose. More... | |
void | setProviderCertificatePassphrase (string $sProviderCertificatePassphrase) |
Set the Provider Certificate passphrase. More... | |
void | setRootCertificationAuthority (string $sRootCertificationAuthorityFile) |
Set the Root Certification Authority file. More... | |
void | setSocketSelectTimeout (integer $nSelectTimeout) |
Set the TCP socket select timeout. More... | |
void | setWriteInterval (integer $nWriteInterval) |
Set the write interval. More... | |
Data Fields | |
const | TIME_BINARY_SIZE = 4 |
integer Timestamp binary size in bytes. More... | |
const | TOKEN_LENGTH_BINARY_SIZE = 2 |
integer Token length binary size in bytes. More... | |
Data Fields inherited from ApnsPHP_Abstract | |
const | CONNECT_RETRY_INTERVAL = 1000000 |
integer Default connect retry interval in micro seconds. More... | |
const | DEVICE_BINARY_SIZE = 32 |
integer Device token length. More... | |
const | ENVIRONMENT_PRODUCTION = 0 |
integer Production environment. More... | |
const | ENVIRONMENT_SANDBOX = 1 |
integer Sandbox environment. More... | |
const | SOCKET_SELECT_TIMEOUT = 1000000 |
integer Default socket select timeout in micro seconds. More... | |
const | WRITE_INTERVAL = 10000 |
integer Default write interval in micro seconds. More... | |
Protected Member Functions | |
array | _parseBinaryTuple (string $sBinaryTuple) |
Parses binary tuples. More... | |
Protected Member Functions inherited from ApnsPHP_Abstract | |
boolean | _connect () |
Connects to Apple Push Notification service server. More... | |
void | _log (string $sMessage) |
Logs a message through the Logger. More... | |
Protected Attributes | |
array | $_aFeedback |
Feedback container. More... | |
$_aServiceURLs | |
array Feedback URLs environments. More... | |
Protected Attributes inherited from ApnsPHP_Abstract | |
array | $_aServiceURLs = array() |
Container for service URLs environments. More... | |
resource | $_hSocket |
SSL Socket. More... | |
ApnsPHP_Log_Interface | $_logger |
Logger. More... | |
integer | $_nConnectRetryInterval |
Connect retry interval in micro seconds. More... | |
integer | $_nConnectRetryTimes = 3 |
Connect retry times. More... | |
integer | $_nConnectTimeout |
Connect timeout in seconds. More... | |
integer | $_nEnvironment |
Active environment. More... | |
integer | $_nSocketSelectTimeout |
Socket select timeout in micro seconds. More... | |
integer | $_nWriteInterval |
Write interval in micro seconds. More... | |
string | $_sProviderCertificateFile |
Provider certificate file with key (Bundled PEM). More... | |
string | $_sProviderCertificatePassphrase |
Provider certificate passphrase. More... | |
string | $_sRootCertificationAuthorityFile |
Root certification authority file. More... | |
The Feedback Service client.
Apple Push Notification Service includes a feedback service that APNs continually updates with a per-application list of devices for which there were failed-delivery attempts. Providers should periodically query the feedback service to get the list of device tokens for their applications, each of which is identified by its topic. Then, after verifying that the application hasn’t recently been re-registered on the identified devices, a provider should stop sending notifications to these devices.
Definition at line 39 of file Feedback.php.
|
protected |
Parses binary tuples.
$sBinaryTuple | A binary tuple to parse. |
Definition at line 113 of file Feedback.php.
Referenced by receive().
array receive | ( | ) |
Receives feedback tuples from Apple Push Notification Service feedback.
Every tuple (array) contains:
timestamp
indicating when the APNs determined that the application no longer exists on the device. This value represents the seconds since 1970, anchored to UTC. You should use the timestamp to determine if the application on the device re-registered with your service since the moment the device token was recorded on the feedback service. If it hasn’t, you should cease sending push notifications to the device. tokenLength
The length of the device token (usually 32 bytes). deviceToken
The device token.Definition at line 66 of file Feedback.php.
References $_aFeedback, ApnsPHP_Abstract::_log(), and _parseBinaryTuple().
|
protected |
|
protected |
array Feedback URLs environments.
Definition at line 44 of file Feedback.php.
const TIME_BINARY_SIZE = 4 |
integer Timestamp binary size in bytes.
Definition at line 41 of file Feedback.php.
const TOKEN_LENGTH_BINARY_SIZE = 2 |
integer Token length binary size in bytes.
Definition at line 42 of file Feedback.php.