nickhatboecker/one-signal-api-bundle

Symfony OneSignal Api Bundle

v2.0.2 2020-01-22 16:04 UTC

This package is auto-updated.

Last update: 2024-04-23 01:00:01 UTC


README

Use the OneSignal PHP API made by Norkunas.

Download the Bundle

$ composer require nickhatboecker/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 Samiax\OneSignalApiBundle\SamiaxOneSignalApiBundle(),
        );
        // ...
    }
    // ...
}

Config

Add this to config.yml:

samiax_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:

$service = $this->get('samiax_one_signal_api.service');

$myApps = $service->apps->getAll();