azasar / yii2-expo
用于处理 Expo 推送通知的 Yii2 扩展
v1.0
2018-02-08 06:27 UTC
Requires
- php: >=7.0.0
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2024-09-29 05:29:24 UTC
README
用于处理 Expo 推送通知的 Yii2 扩展
安装
安装此扩展的首选方法是通过 composer。
运行以下命令之一:
php composer.phar require --prefer-dist azasar/yii2-expo "*"
或者将以下内容添加到你的 composer.json 文件中的 require 部分:
"azasar/yii2-expo": "*"
配置
扩展安装完成后,将其添加到你的配置文件(main.php)中
'expo' => [
'class' => 'azasar\expo\ExpoPush'
],
使用
$data = [
'title' => 'Some title',
'text' => 'Some text'
];
$notification = ['body' => $text, 'data' => $data];
\Yii::$app->expo->notify('ExponentPushToken[xxxxxxxxxxxxx]', $notification);
$data 是可选的