2017 © Pedro Peláez
 

library umeng

umeng for laravel

image

hskyzhou/umeng

umeng for laravel

  • Thursday, August 24, 2017
  • by xezw211
  • Repository
  • 1 Watchers
  • 0 Stars
  • 41 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 4 Versions
  • 3 % Grown

The README.md

umeng for laravel5

install

composer require hskyzhou/umeng, (*1)

config

Add the package to your application service providers in config/app.php file., (*2)

'providers' => [

    /*
     * Laravel Framework Service Providers...
     */
    Illuminate\Foundation\Providers\ArtisanServiceProvider::class,
    Illuminate\Auth\AuthServiceProvider::class,
    ...

    /**
     * Third Party Service Providers...
     */
    HskyZhou\Umeng\ServiceProvider::class,

],

Add the package to your aliases in config/app.php file., (*3)

'aliases' => [

    /**
     * Third Party Service Providers...
     */
    'AppNotification' => HskyZhou\Umeng\Facades\AppNotificationFacade::class

],

use

    //调用ios
    $ios = AppNotification::ios();
    $android = AppNotification::android();

    //必要参数
    $predefined = [];
    //额外字段
    $extraField = [];

    //单播
    $iosUnicast = AppNotification::ios()->unicast($predefined, extraField);
    $androidUnicast = AppNotification::android()->unicast($predefined, extraField);

    //列播
    $iosUnicast = AppNotification::ios()->listcast($predefined, extraField);
    $androidUnicast = AppNotification::android()->listcast($predefined, extraField);

    //组播
    $iosUnicast = AppNotification::ios()->groupcast($predefined, extraField);
    $androidUnicast = AppNotification::android()->groupcast($predefined, extraField);

    //文件播
    $iosUnicast = AppNotification::ios()->filecast($predefined, extraField);
    $androidUnicast = AppNotification::android()->filecast($predefined, extraField);

    //广播
    $iosUnicast = AppNotification::ios()->broadcast($predefined, extraField);
    $androidUnicast = AppNotification::android()->broadcast($predefined, extraField);

    //自定义播
    $iosUnicast = AppNotification::ios()->customizedcast($predefined, extraField);
    $androidUnicast = AppNotification::android()->customizedcast($predefined, extraField);

    //ios可以重新设置值
    $iosUnicast = AppNotification::ios()->unicast();
    //设置值
    $iosUnicast->setPredefinedKeyValue('name', 'hsky');
    //设置额外值
    $iosUnicast->setCustomizedField('name', 'hsky');

    //android重新设置值
    $androidUnicast = AppNotification::android()->unicast();
    //设置值
    $iosUnicast->setPredefinedKeyValue('name', 'hsky');
    //设置额外值
    $iosUnicast->setExtraField('name', 'hsky');

example

  1. 向ios用户单独发送一条消息
    $predefined = [
        "device_tokens" =>  "d14f29e47c098fd9429fdc56d4da2d3cef69914db7da179419f17188e3a7e80d",
        "alert" => "IOS 单播测试", 
        "badge" => 0,
        "sound" => "chime",
        "production_mode" => "false",
    ];

    $extraField = [
        "url" => "http://www.baidu.com",
        "isapp" => "true",
    ];

    AppNotification::ios()->unicast($predefined, $extraField)->send();

The Versions

24/08 2017

dev-master

9999999-dev

umeng for laravel

  Sources   Download

MIT

The Requires

 

24/08 2017

1.2

1.2.0.0

umeng for laravel

  Sources   Download

MIT

The Requires

 

24/08 2017

1.1

1.1.0.0

umeng for laravel

  Sources   Download

MIT

The Requires

 

14/08 2017

1.0

1.0.0.0

umeng for laravel

  Sources   Download

MIT

The Requires