borsaco/pushe-notification-bundle

PHP pushe.co API 包装器,适用于 Symfony 应用程序

安装: 0

依赖者: 0

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 0

开放问题: 0

类型:symfony-bundle

1.0.0 2019-07-09 07:13 UTC

This package is auto-updated.

Last update: 2024-09-15 19:00:24 UTC


README

PHP pushe.co API 包装器,适用于 Symfony 应用程序

安装

通过 Composer

composer require borsaco/pushe-notification-bundle

初始化

首先使用从 http://poushe.co 获得的代码和令牌进行初始化

编辑你的 app/AppKernel.php,在 registerBundles() 方法中注册此扩展,如上所示

class AppKernel extends Kernel
{

    public function registerBundles()
    {
        $bundles = array(
            // ...
            // register the bundle here
            new Borsaco\PusheNotificationBundle\PusheNotificationBundle()
        );
    }
}

然后,你必须配置令牌以发送通知。你可以从 pushe.co 获取令牌,并在配置文件中添加配置

pushe_notification:
    token: "7fb1***********29b464c"

用法

在任何可以访问服务容器的地方

$pushNotification = $this->container->get('pushe_notification');
$pushNotification->send();

更多

你可以在 https://github.com/Borsaco/PusheNotification 找到更多帮助