Giter Site home page Giter Site logo

jjpush's Introduction

jujiang/push

Getting started

$ composer require jujiang/jjpush

Usage

// 目前支持 华为,小米,vivo,oppo,如果只用部分,config删除对应配置
$push = new PushManage([
        'hms' => [
        'appid' => 'xxxx',
        'client_id' => 'xxxx',
        'client_secret' => 'xxxx',
    ],
    'xm' => [
        'android' => [
            'package' => 'xxx',
            'app_secret' => 'xxxx'
        ],
        'ios' => [
            'package' => 'cxxxx',
            'app_secret' => 'xxxx'
        ]
    ],
    'vivo' => [
        'appid' => 'xxxxx',
        'app_key' => 'xxxx',
        'app_secret' => 'xxxxxx',
        'env' => 1, // 0 正式  1测试
    ],
    'oppo' => [
        'app_key' => 'xxxx',
        'app_secret' => 'xxxxxx',
    ]
]);

// 广播
$push->setTitle('测试标题')->setContent('测试内容')->setExtra(['a' => 1, 'b' => 2])->push();

// 别名发送
$push->setTitle('您收到一条消息')->setContent('今天天气真好')->setExtra(['a' => 444, 'b' => 55555])->pushAlias('aaaaaaa');

// 标签发送
$push->setTitle('测试标题22')->setContent('测试内容33')->setExtra(['a' => 1, 'b' => 2])->pushTag('aaaaaaa');

// 设置别名 OPPO
$push->setAlias("aaaaaaa", "CN_d3f9b29f401457966009a3feb9849e0f", 'oppo');

// 设置tag OPPO
$push->unsetAlias("aaaaaaa", 'oppo');

// 取消别名 OPPO
$push->setTag("aaaaaaa", 'CN_d3f9b29f401457966009a3feb9849e0f', 'oppo');

// 取消tag OPPO
$push->unsetTag("aaaaaaa", 'CN_d3f9b29f401457966009a3feb9849e0f', 'oppo');

jjpush's People

Contributors

a289459798 avatar zhangzy2345 avatar

Watchers

 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.