Пример #1
0
<?php

/**
 * Usage Examples
 *
 * @author  Sebastian Borggrewe <*****@*****.**>
 * @since   2010/01/24
 * @package APNP
 */
error_reporting(E_ALL | E_STRICT);
include 'APNSBase.php';
include 'APNotification.php';
include 'APFeedback.php';
try {
    # Notification Example
    $notification = new APNotification('production');
    $notification->setDeviceToken("e1fc74f98def8ae160e0e1d56d4abb7507a5d2d543962c5f0c0077217eee4ab3");
    $notification->setMessage("Test Push");
    $notification->setBadge(1);
    $notification->setPrivateKey('Vintelli.pem');
    $notification->setPrivateKeyPassphrase('b3net');
    $notification->send();
    # Feedback Example
    //$feedback = new APFeedback('development');
    //$feedback->setPrivateKey('Vintelli.pem');
    //$feedback->setPrivateKeyPassphrase('b3net');
    //$feedback->receive();
} catch (Exception $e) {
    echo $e->getLine() . ': ' . $e->getMessage();
}
Пример #2
0
<?php

/**
 * Usage Examples
 *
 * @author  Sebastian Borggrewe <*****@*****.**>
 * @since   2010/01/24
 * @package APNP
 */
error_reporting(E_ALL | E_STRICT);
include 'APNSBase.php';
include 'APNotification.php';
include 'APFeedback.php';
try {
    # Notification Example
    $notification = new APNotification('development');
    $notification->setDeviceToken("xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx");
    $notification->setMessage("Test Push");
    $notification->setBadge(1);
    $notification->setPrivateKey('certificate/apns-dev.pem');
    $notification->setPrivateKeyPassphrase('test');
    $notification->send();
    # Feedback Example
    $feedback = new APFeedback('development');
    $feedback->setPrivateKey('certificate/apns-dev.pem');
    $feedback->setPrivateKeyPassphrase('test');
    $feedback->receive();
} catch (Exception $e) {
    echo $e->getLine() . ': ' . $e->getMessage();
}