承接 albaraam/yii2-gcm-apns 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

albaraam/yii2-gcm-apns

Composer 安装命令:

composer require albaraam/yii2-gcm-apns

包简介

Yii2 component as wrapper of the "albaraam/php-gcm-apns" library to handle mobile push notifications.

README 文档

README

Yii2 component as wrapper of the "albaraam/php-gcm-apns" library to handle mobile push notifications.

Installation

The preferred way to install this extension is through composer.

Either run

composer require albaraam/yii2-gcm-apns "~1.0.0"

or add

"albaraam/yii2-gcm-apns": "~1.0.0"

to the require section of your composer.json.

Usage

Add & configure the component in your config file:

'components' => [
    'gcmApns' => [
        'class' => 'albaraam\yii2_gcm_apns\GcmApns',
        'google_api_key'=>'your_google_api_key',
        'environment'=>\albaraam\yii2_gcm_apns\GcmApns::ENVIRONMENT_SANDBOX,
        'pem_file'=>'path/to/pem/file'
    ],
]

Access it anywhere in your application like the following:

// Message creation through the message builder.
$message = Yii::$app()->gcmApns->messageBuilder("Title","Body");

// Common attributes for both ios and android
$message
	->setTitle("Title")
	->setBody("Body")
	->setSound("sound.mp3")
	->setData(['foo'=>'bar']);

// Android specific attributes
$message->android
	->setTo("ids")
	->setIcon("icon")
	->setCollapseKey("collapse_key")
	->setColor("#333");

// IOS specific attributes
$message->ios
	->setTo("ids")
	->setSound("sound_ios.mp3") // custom sound for ios
	->setBadge(3);

// Send message
Yii::$app->gcmApns->send($message);

统计信息

  • 总下载量: 1.44k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-12-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固