frknikiz / fast-gcm-topic
向 GCM(Google Cloud Messaging)主题发送消息。轻松地向设备发送推送通知
1.0.1
2015-08-05 17:54 UTC
Requires
- php: >=5.4.0
- illuminate/support: 4.2.*
- php-curl-class/php-curl-class: ^3.6
This package is not auto-updated.
Last update: 2024-09-28 19:09:28 UTC
README
通过使用 GCM(Google Cloud Messaging)主题,轻松地向设备发送推送通知。
此包仅适用于 Laravel 4.*
库功能
- 向设备发送主题消息。
安装
首先,通过 Composer 安装此包。编辑您的项目 composer.json
"require": {
"frknikiz/fast-gcm-topic":"1.0.*"
}
接下来,在终端中更新 Composer
composer update
打开 app/config/app.php,并向 providers 数组中添加一个新项目。
'Frknikiz\Fastgcmtopic\FastgcmtopicServiceProvider'
从终端发布配置
php artisan config:publish frknikiz/fast-gcm-topic
最后,您必须在 app/config/packages/frknikiz/fast-gcm-topic/conf.php
中输入从 Google Cloud Messaging API 获得的关键字值
用法
$topic_link='/topics/foo-bar';
$data=array(
'title'=>"Hello",
'message'=>"World !!"
);
$response=FastGcmTopic::sendTopic($topic_link,$data);
dd($response);
输出
object(stdClass)[138]
public 'message_id' => float 8.2346410779436E+18
有关主题消息的更多信息,请参阅:主题消息
参考
Php Curl Class 许可证
Copyright 2015 Furkan İKİZ.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://apache.ac.cn/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.