tinpont/pushbox 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

tinpont/pushbox

Composer 安装命令:

composer require tinpont/pushbox

包简介

Pushbox is a universal notification push container for apple apns, google gcm, sms etc.

README 文档

README

Pushbox is a universal notification push container for apple apns, google gcm, sms etc.

Apns Adapter: https://github.com/tinpont/pushbox/blob/master/APNS.md

Installation

Update your composer.json file to include these packages as a dependency.

"tinpont/pushbox": "dev-master"

Custom your Adapter

Create a php file at whatever you like, extends Tinpont\Pushbox\Adapter

<?php

namespace John\Pushbox;


use Tinpont\Pushbox\Device;
use Tinpont\Pushbox\Options;
use Tinpont\Pushbox\Adapter;

class Sms extends Adapter {
}

Overwrite push and isValidToken method

public function push($message) {
  $this->success = $this->fails = [];

  // You can do what you like here.
  $response = $this->sendSms('12306');

  if ($response['status']) {
    $this->success[] = $response;
  } else {
    $this->fails[] = $response;
  }

  return $this;
}

protected function isValidToken($token) {
  // $token maybe a cellphone number.
  return ctype_digit($token);
}

Then you can handle response by yourself.

$success = $sms->success();
$fails = $sms->fails();

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-12-17