PHP code example of pandelix / u-push

1. Go to this page and download the library: Download pandelix/u-push library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pandelix / u-push example snippets


...
use UPush\Client as Upush;
...

$app_infos = [
    'android' => ['appkey' => 'xx', 'secret' => 'xx'],
    'ios' => ['appkey' => 'xx', 'secret' => 'xx']
];
$client = new Upush($app_infos);
$ret = $client->test()->sendListcast('xx,xx', ['custom' => 'xxxxx'], 'message');
if ($ret === true) {
    echo '发送成功' . PHP_EOL;
} else {
    echo $ret;
}

...