gulaandrij/one-signal-api-bundle

Symfony OneSignal Api Bundle

安装: 5

依赖者: 0

建议者: 0

安全性: 0

星星: 1

关注者: 1

分支: 4

类型:symfony-bundle

3.0.0 2020-06-03 11:09 UTC

This package is auto-updated.

Last update: 2024-08-29 05:25:01 UTC


README

使用Norkunas制作的OneSignal PHP API OneSignal PHP API

下载Bundle

$ composer require gulaandrij/one-signal-api-bundle

启用Bundle

在项目的app/AppKernel.php文件中注册的Bundle

<?php
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new GulaAndrij\OneSignalApiBundle\GulaAndrijOneSignalApiBundle(),
        );
        // ...
    }
    // ...
}

配置

将以下内容添加到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}"

基本用法

获取所有应用

  • services.yaml
    App\Controller\Admin\DashboardController:
        arguments: ['@one_signal_api.service']
  • DashboardController.php
$service = $this->get('one_signal_api.service');

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