tecsvit/yii2-apns
Composer 安装命令:
composer require tecsvit/yii2-apns
包简介
Extension for sending Apple push notification
关键字:
README 文档
README
Extension for sending Apple push notification
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist tecsvit/yii2-apns "*"
or add
"tecsvit/yii2-apns": "*"
to the require section of your composer.json file.
Usage
Once the extension is installed, simply use it in your code by:
into config file:
'components' => [ ... 'apns' => [ 'class' => '\tecsvit\apns\src\Sender', 'apnsHostProd' => 'gateway.push.apple.com', 'apnsHostTest' => 'gateway.sandbox.push.apple.com', 'apnsPort' => 2195, 'apnsCertProd' => dirname(__DIR__) . '/path/to/prod-serc/apple_push_notification_production.pem', 'apnsCertTest' => dirname(__DIR__) . '/path/to/test-serc/apple_push_notification_test.pem', 'apnsPassphrase'=> dirname(__DIR__) . '/path/to/passphare', 'timeout' => 500000, //microseconds, 'mode' => 'prod' //'prod', 'dev' or 'test', default 'dev' ], ... ]
into your code:
/** * @param array $alert Example: ['alert' => 'Push Message'] * @param string $token Apple token device * @param bool $closeAfterPush Close the connection after the push? */ Yii::$app->apns->send($alert, $token, $closeAfterPush); ?>
统计信息
- 总下载量: 96
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2017-03-01