Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 933 Bytes

overview.md

File metadata and controls

30 lines (22 loc) · 933 Bytes

Getting Started

Simple usage looks like:

$wonderpush = new \WonderPush\WonderPush(WONDERPUSH_ACCESS_TOKEN, WONDERPUSH_APPLICATION_ID);
$response = $this->api->create(
    \WonderPush\Params\DeliveriesCreateParams::_new()
        ->setTargetSegmentIds('@ALL')
        ->setNotification(\WonderPush\Notification::_new()
            ->setAlert(\WonderPush\NotificationAlert::_new()
                ->setTitle('Using the PHP library')
                ->setText('Hello, WonderPush!')
            ))
);
echo $response->getNotificationId();

Configuring a Logger

The library does minimal logging, but it can be configured with a PSR-3 compatible logger so that messages end up there instead of error_log:

$wonderpush->setLogger($logger);

API Reference

Take a look at the methods exposed by the \WonderPush\WonderPush class.