2017 © Pedro Peláez
 

library easypush

A package for push messages

image

loopeer/easypush

A package for push messages

  • Friday, August 4, 2017
  • by dengyongbin
  • Repository
  • 13 Watchers
  • 1 Stars
  • 25 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

EasyPush

Installation

shell composer require loopeer/easypush, (*1)

Configuration

  1. 注册 ServiceProviderFacade:, (*2)

    Loopeer\EasyPush\Providers\EasyPushProvider::class,
    
    'EasyPush' => \Loopeer\EasyPush\Facades\EasyPushFacade::class,
    
  2. 发布配置文件, (*3)

    php artisan vendor:publish
    

    发布后请修改app/config/easypush.php 中对应的配置项, (*4)

Usage

  1. 对单个用户推送消息
app('easypush')->pushToSingle($push, $title, $content, $custom);
//或
EasyPush::pushToSingle($push, $title, $content, $custom);
  1. 对多个用户推送消息
app('easypush')->pushToList($pushes, $title, $content, $custom);
//或
EasyPush::pushToList($pushes, $title, $content, $custom);
  1. 全局推送消息
app('easypush')->pushToAll($title, $content, $custom);
//或
EasyPush::pushToAll($title, $content, $custom);

Parameters

  • push: 推送参数,格式为对象或数组
    • channel: 所属渠道(0-个推, 1-小米)
    • client_id: 推送渠道用户id
    • platform: 设备(ios, android)
  • title: 推送标题
  • content: 推送内容
  • custom: 自定义推送内容

The Versions

04/08 2017

dev-master

9999999-dev

A package for push messages

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

by Avatar LilHorse