openium / platinium-bundle
为您的 Symfony4 项目提供 Platinium 推送通知
v1.1.6
2019-10-15 13:38 UTC
Requires
- php: >=7.1
- ext-curl: *
- ext-json: *
- symfony/framework-bundle: ^4.0
Requires (Dev)
- phpunit/phpunit: ^6
- symfony/phpunit-bridge: ^4.0
This package is not auto-updated.
Last update: 2024-09-25 13:00:32 UTC
README
此扩展包提供了一种使用 Platinium 发送推送消息的简单方法
注意
版本 < 1.1.6 已弃用
安装
打开命令行控制台,进入您的项目目录并执行
$ composer require openium/platinium-bundle
配置
您需要在 .env 中添加 4 项信息
###> openium/platinium-bundle ###
PLATINIUM_SERVER_ID=
PLATINIUM_SERVER_KEY=
PLATINIUM_SERVER_TOKEN_DEV=
PLATINIUM_SERVER_TOKEN_PROD=
###< openium/platinium-bundle ###
用法
示例
// set by dependency injection $notifier = new PlatiniumNotifier(...); // get number of future pushed devices $deviceCount = $notifier->subscribe($groups, $langs, $langNotIn, $latitude, $longitude, $tolerance, $radius, $paramsBag, $badgeValue, $newsStand, $sound); // send a push message $pushSended = $notifier->notify($message, $groups, $langs, $langNotIn, $latitude, $longitude, $tolerance, $radius);