Skip to content

Latest commit

 

History

History
57 lines (40 loc) · 1.55 KB

README.md

File metadata and controls

57 lines (40 loc) · 1.55 KB

Latest Stable Version Total Downloads Latest Unstable Version License

OnesignalApiBundle

Integrate OneSignal API in Symfony with ease.

Use the PHP library made by Norkunas.

Setup

Install with Composer

composer require dizda/onesignal-api-bundle

Add bundle to app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        ....
        new Dizda\OnesignalApiBundle\DizdaOnesignalApiBundle()
    );
}

Configuration

Add this to your config.yml:

dizda_onesignal_api:
    app_id:       %onesignal_app_id%
    app_auth_key: %onesignal_app_auth_key%

Use

Send a simple notification:

$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.