openium/platinium-bundle

为您的 Symfony4 项目提供 Platinium 推送通知

安装: 337

依赖者: 0

建议者: 0

安全性: 0

星标: 0

关注者: 6

分支: 0

公开问题: 0

类型:symfony-bundle

v1.1.6 2019-10-15 13:38 UTC

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