2017 © Pedro Peláez
 

library zfs-push-notification

ZFSPushNotification

image

zfstarter/zfs-push-notification

ZFSPushNotification

  • Thursday, May 22, 2014
  • by farior2109
  • Repository
  • 1 Watchers
  • 0 Stars
  • 58 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

ZFSPushNotification

Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

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);

The Versions

22/05 2014

dev-master

9999999-dev https://github.com/naxel/ZFSPushNotification

ZFSPushNotification

  Sources   Download

BSD-3-Clause

The Requires

 

zf2 zfs zfstarter zfspushnotification