2017 © Pedro Peláez
 

library pushbox

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

image

tinpont/pushbox

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

  • Thursday, January 8, 2015
  • by tinpont
  • Repository
  • 2 Watchers
  • 3 Stars
  • 69 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 5 % Grown

The README.md

pushbox

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

Apns Adapter: https://github.com/tinpont/pushbox/blob/master/APNS.md, (*2)

Installation

Update your composer.json file to include these packages as a dependency., (*3)

"tinpont/pushbox": "dev-master"

Custom your Adapter

Create a php file at whatever you like, extends Tinpont\Pushbox\Adapter, (*4)

<?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, (*5)

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., (*6)

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

The Versions

08/01 2015

dev-master

9999999-dev https://github.com/tinpont/pushbox

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

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Tinpont Liu

sms message notification apple ios push gcm apns android iphone pusher pushbox