dev-master
9999999-dev https://github.com/naxel/ZFSPushNotificationZFSPushNotification
BSD-3-Clause
The Requires
- php >=5.3.3
- zendframework/zendframework 2.*
zf2 zfs zfstarter zfspushnotification
Wallogit.com
2017 © Pedro Peláez
ZFSPushNotification
ZFSPushNotification, (*2)
Добавляем в composer.json:, (*3)
{
"require-dev": {
"zfstarter/zfs-push-notification": "dev-master"
}
}
И обновляем зависимость:, (*4)
$ curl -s http://getcomposer.org/installer | php $ php composer.phar update
В config\autoload\global.php, (*5)
указываем SMTP настройки, дефолтные мыло и имя отправителя, а также, если необходимо заголовки:, (*6)
return array(
//...
'ZFSPushNotification' => array(
'pathToPem' => realpath('file.p12.pem'),
'sandbox' => true,
),
);
В config\autoload\application.config.php включаем модуль, (*7)
'modules' => array(
//...
'ZFSPushNotification'
),
);
Также нужно убедиться, что у вас уже создана под него табличка:, (*8)
CREATE TABLE `user_tokens` ( `user_id` int(11) NOT NULL, `token` varchar(64) NOT NULL, `created` timestamp NULL DEFAULT NULL, PRIMARY KEY (`user_id`,`token`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8
use ZFStarterMail\Model\Mail;
//...
$params = array(
'userId' => 22,
'message' => 'My notification!!!',
'actionLocKey' => 'PLAY',
'locKey' => 'GAME_PLAY_REQUEST_FORMAT',
'locArgs' => array('Jenna', 'Frank'),
'launchImage' => 'Play.png',
'badge' => 5,
'sound' => 'bingbong.aiff',
);
PushNotification::sendNotification($this->getServiceLocator(), $params);
ZFSPushNotification
BSD-3-Clause
zf2 zfs zfstarter zfspushnotification