doc
1 year ago
lib
2 months ago
tests
1 year ago
.coveralls.yml
1 year ago
.git
1 year ago
.gitignore
1 year ago
.travis.yml
1 year ago
LICENSE.txt
1 year ago
README.md
1 year ago
build.php
1 year ago
composer.json
1 year ago
init.php
5 months ago
overview.md
1 year ago
phpunit.no_autoload.xml
1 year ago
phpunit.xml
1 year ago
release.php
1 year ago
test
1 year ago
overview.md
31 lines
| 1 | ## Getting Started |
| 2 | |
| 3 | Simple usage looks like: |
| 4 | |
| 5 | ```php |
| 6 | $wonderpush = new \WonderPush\WonderPush(WONDERPUSH_ACCESS_TOKEN, WONDERPUSH_APPLICATION_ID); |
| 7 | $response = $this->api->create( |
| 8 | \WonderPush\Params\DeliveriesCreateParams::_new() |
| 9 | ->setTargetSegmentIds('@ALL') |
| 10 | ->setNotification(\WonderPush\Notification::_new() |
| 11 | ->setAlert(\WonderPush\NotificationAlert::_new() |
| 12 | ->setTitle('Using the PHP library') |
| 13 | ->setText('Hello, WonderPush!') |
| 14 | )) |
| 15 | ); |
| 16 | echo $response->getNotificationId(); |
| 17 | ``` |
| 18 | |
| 19 | |
| 20 | ### Configuring a Logger |
| 21 | |
| 22 | The library does minimal logging, but it can be configured with a [](http://www.php-fig.org/psr/psr-3/`PSR-3` compatible logger](http://www.php-fig.org/psr/psr-3/](http://www.php-fig.org/psr/psr-3/) so that messages end up there instead of `error_log`: |
| 23 | |
| 24 | ```php |
| 25 | $wonderpush->setLogger($logger); |
| 26 | ``` |
| 27 | |
| 28 | ## API Reference |
| 29 | |
| 30 | Take a look at the methods exposed by the [](class-WonderPush.WonderPush.html\WonderPush\WonderPush](class-WonderPush.WonderPush.html](class-WonderPush.WonderPush.html) class. |
| 31 |