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

3.0.0 2020-06-03 11:09 UTC

This package is auto-updated.

Last update: 2024-03-29 04:12:33 UTC


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();