dizda / onesignal-api-bundle
OneSignal API Bundle for Symfony.
Installs: 10 410
Dependents: 0
Suggesters: 0
Security: 0
Stars: 8
Watchers: 2
Forks: 7
Open Issues: 2
Requires
- php: >=5.4.0
- norkunas/onesignal-php-api: v0.1.0
- symfony/framework-bundle: ~2.3
This package is not auto-updated.
Last update: 2024-12-18 04:13:54 UTC
README
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.