laszlo-karpati/gcm-bundle
Composer 安装命令:
composer require laszlo-karpati/gcm-bundle
包简介
Endroid Google Cloud Messaging Bundle for Symfony
关键字:
README 文档
README
By endroid
This bundle enables you to use the Endroid Google Cloud Messaging (endroid/Gcm) library as a decoupled service and enables configuration through the Symfony framework. Google Cloud Messaging is a service that helps developers send data from servers to their Android applications on Android devices. For more information on the services provided see the endroid/Gcm repository and Google GCM.
Requirements
Installation
Add in your composer.json
{ "require": { "endroid/gcm-bundle": "dev-master" } }
Install the bundle
$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update endroid/gcm-bundle
Composer will install the bundle to your project's vendor/endroid directory.
Enable the bundle via the kernel
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Endroid\Bundle\GcmBundle\EndroidGcmBundle(), ); }
Configuration
config.yml
endroid_gcm: api_key: "Your API Key (use the Browser key)"
Usage
After installation and configuration, the service can be directly referenced from within your controllers.
<?php public function gcmSendAction() { $gcm = $this->get('endroid.gcm'); $registrationIds = array( // Registration ID's of devices to target ); $data = array( 'title' => 'Message title', 'message' => 'Message body', ); $response = $gcm->send($data, $registrationIds); ... }
License
This bundle is under the MIT license. For the full copyright and license information, please view the LICENSE file that was distributed with this source code.
统计信息
- 总下载量: 19
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2013-04-19