PHP code example of wonderpush / wonderpush-php-lib
1. Go to this page and download the library: Download wonderpush/wonderpush-php-lib 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/ */
wonderpush / wonderpush-php-lib example snippets
$wonderpush = new \WonderPush\WonderPush(WONDERPUSH_ACCESS_TOKEN, WONDERPUSH_APPLICATION_ID);
$response = $wonderpush->deliveries()->create(
\WonderPush\Params\DeliveriesCreateParams::_new()
->setTargetSegmentIds('@ALL')
->setNotification(\WonderPush\Obj\Notification::_new()
->setAlert(\WonderPush\Obj\NotificationAlert::_new()
->setTitle('Using the PHP library')
->setText('Hello, WonderPush!')
))
);
echo $response->getNotificationId();
$wonderpush->setLogger($logger);
bash
composer
bash
vendor/bin/phpunit tests/SomeTest.php