GithubHelp home page GithubHelp logo

getui-laravel5's Introduction

getui

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

#安装方法

在项目目录下

composer require echobool/getui-laravel5

或在 composer.json 中添加

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

然后

  composer update

如果无法安装 请执行一下

composer update nothing 

然后

composer update

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

执行

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

配置 config/getui.php

#使用方法

在控制器中 use Getui; 在方法中

     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 类中的写法 后面会整理规范一些.

getui-laravel5's People

Contributors

echobool avatar

Watchers

James Cloos avatar 江河 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.