PHP code example of echobool / getui-laravel5

1. Go to this page and download the library: Download echobool/getui-laravel5 library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

echobool / getui-laravel5 example snippets


     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'=>'自定义数据'];