2017 © Pedro Peláez
 

library getui-laravel5

Getui expansion for Laravel5

image

echobool/getui-laravel5

Getui expansion for Laravel5

  • Monday, July 3, 2017
  • by echobool
  • Repository
  • 2 Watchers
  • 5 Stars
  • 2,413 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 5 Open issues
  • 7 Versions
  • 21 % Grown

The README.md

getui

个推laravel5扩展包, 根据官方最新SDK包整理, (*1)

安装方法

在项目目录下, (*2)

composer require echobool/getui-laravel5

或在 composer.json 中添加, (*3)

"echobool/getui-laravel5": "^1.0"

然后, (*4)

  composer update

如果无法安装 请执行一下, (*5)

composer update nothing 

然后, (*6)

composer update

在config/app.php 'providers' 中添加 Echobool\Getui\GetuiServiceProvider::class, 'aliases' 中添加 'Getui' => Echobool\Getui\Facades\Getui::class,, (*7)

执行, (*8)

 php artisan config:cache 清空配置缓存

 php artisan vendor:publish --provider="Echobool\Getui\GetuiServiceProvider" 将配置文件发布到config文件夹中

配置 config/getui.php, (*9)

使用方法

在控制器中 use Getui; 在方法中, (*10)

     public function index()
     {
        $cid = ; //你数据库中存储的cid ;
        $data = ['name'=>'echobool'];
        $template_id = 1; //是发送模板
        Getui::pushMessageToSingle($cid,$data,$template_id);

        //下面这个是只针对 IOS的推送 自己选择使用
        $data = ['content'=>'content','body'=>'这是内容','title'=>'这是一个标题','text'=>'texts'];
        Getui::pushAPNL($DeviceToken,$data);
     }

    模板对应参数$data如下

    template_id==1时 //安卓通知栏推送  //通知透传 //IPHONE 会在应用内弹出提示
    $data = ['content'=>'content','title'=>'这是一个标题','text'=>'texts'];

    template_id==2时 //这是下载模板  ios不支持
    $data=['notyTitle'=>'notyTitle',
            'notyContent'=>'notyContent',
            'popTitle'=>'popTitle',
            'popContent'=>'popContent',
            'loadTitle'=>'loadTitle',
            'loadUrl'=>'http://www.echobool.com',
            ];

    template_id==3时 //通知连接模板   安卓在通知栏打开连接   ios要在应用内弹出对话框 点击打开safari
    $data=['title'=>'title','text'=>'text','url'=>'http://baidu.com'];

    template_id==4时 //IPHONE 通知栏提示 //安卓会启动应用 可在应用内拿到透传的内容
    $data = ['content'=>'透传内容','body'=>'这是内容','title'=>'这是一个标题','payload'=>'自定义数据'];

其它用法直接参考GetuiPush 类中的写法 后面会整理规范一些., (*11)

The Versions

03/07 2017

dev-master

9999999-dev https://github.com/echobool/getui-laravel5

Getui expansion for Laravel5

  Sources   Download

MIT

The Requires

 

by Luojinyi

laravel laravel5 getui

30/11 2016

1.5

1.5.0.0 https://github.com/echobool/getui-laravel5

Getui expansion for Laravel5

  Sources   Download

MIT

The Requires

 

by Luojinyi

laravel laravel5 getui

17/10 2016

1.4

1.4.0.0 https://github.com/echobool/getui-laravel5

Getui expansion for Laravel5

  Sources   Download

MIT

The Requires

 

by Luojinyi

laravel laravel5 getui

23/09 2016

1.3

1.3.0.0 https://github.com/echobool/getui-laravel5

Getui expansion for Laravel5

  Sources   Download

MIT

The Requires

 

by Luojinyi

laravel laravel5 getui

23/09 2016

1.2

1.2.0.0 https://github.com/echobool/getui-laravel5

Getui expansion for Laravel5

  Sources   Download

MIT

The Requires

 

by Luojinyi

laravel laravel5 getui

23/09 2016

1.1

1.1.0.0 https://github.com/echobool/getui-laravel5

Getui expansion for Laravel5

  Sources   Download

MIT

The Requires

 

by Luojinyi

laravel laravel5 getui

23/09 2016

1.0

1.0.0.0 https://github.com/echobool/getui-laravel5

Getui expansion for Laravel5

  Sources   Download

MIT

The Requires

 

by Luojinyi

laravel laravel5 getui