gulaandrij / one-signal-api-bundle
Symfony OneSignal Api Bundle
Installs: 5
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 4
Type:symfony-bundle
Requires
- php: >=5.5
- guzzlehttp/guzzle: ^6.0
- norkunas/onesignal-php-api: ^2.0
- nyholm/psr7: ^1.3
- php-http/client-common: ^2.1
- php-http/guzzle6-adapter: ^1.0|^2.0
- psr/http-client: ^1.0
- symfony/framework-bundle: ^3.0|^4.0|^5.0
- symfony/http-client: ^5.1
- symfony/http-client-contracts: ^2.1
README
Use the OneSignal PHP API made by Norkunas.
Download the Bundle
$ composer require gulaandrij/one-signal-api-bundle
Enable the Bundle
Registered bundles in the app/AppKernel.php
file of your project:
<?php class AppKernel extends Kernel { public function registerBundles() { $bundles = array( // ... new GulaAndrij\OneSignalApiBundle\GulaAndrijOneSignalApiBundle(), ); // ... } // ... }
Config
Add this to config.yml:
one_signal_api: app_id: "{ONE_SIGNAL_API_APP_ID}" app_auth_key: "{ONE_SIGNAL_API_APP_AUTH_KEY}" user_auth_key: "{ONE_SIGNAL_API_USER_AUTH_KEY}"
Basic Use
Gets all apps:
- services.yaml:
App\Controller\Admin\DashboardController: arguments: ['@one_signal_api.service']
- DashboardController.php
$service = $this->get('one_signal_api.service'); $myApps = $service->apps->getAll();