Skip to content

Commit

Permalink
use case
Browse files Browse the repository at this point in the history
  • Loading branch information
dizda committed Jul 5, 2015
1 parent aed3204 commit b28d82e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,25 @@ dizda_onesignal_api:
app_auth_key: %onesignal_app_auth_key%
```
## Use
Send a simple notification:
```php
$client = $this->get('dizda_onesignal_api.service.client');

$client->notifications->add([
'headings' => [
'en' => 'Withdraw'
],
'contents' => [
'en' => 'Your withdraw has been sent!'
],
'included_segments' => ['All'],
'url' => 'http://google.fr'
]);
```

## License

MIT Licensed, see LICENSE.
13 changes: 12 additions & 1 deletion src/Command/CreateNotificationCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ protected function configure()
protected function execute(InputInterface $input, OutputInterface $output)
{
$client = $this->getContainer()->get('dizda_onesignal_api.service.client');
var_dump($client);
$client->notifications->add([
'headings' => [
'en' => 'Withdraw'
],
'contents' => [
'en' => 'Your withdraw has been sent!'
],
'include_player_ids' => ['6de78980-2297-11e5-ae29-43aa3272e73b'],
// 'included_segments' => ['All'],
// 'data' => ['foo' => 'bar'],
'url' => 'http://bitter.io/privacy'
]);
}
}

0 comments on commit b28d82e

Please sign in to comment.