package com.laihua.vivopushtestlib;

import com.vivo.push.sdk.notofication.Message;
import com.vivo.push.sdk.notofication.Result;
import com.vivo.push.sdk.server.Sender;

public class MyClass {
    public static void main(String[] args) {
        try {
            //推送测试,运行之后可以直接在手机上收到推送.
            Sender sender = new Sender("ccb2170d-3ded-499b-9779-f1a904edd98d");
            Result result = sender.getToken(105483822 ,   "cca2ba3da947c84ca7544e78237fca1c");
            sender.setAuthToken(result. getAuthToken());
            Message singleMessage = new Message.Builder()
                    //将此id改为手机注册成功之后的id,可能需要在vivo后台添加为测试设备
                    .regId("16214127740408382238160")
                    .notifyType(3)
                    .title("push title test1111")
                    .content("push content test 22222")
                    .timeToLive(1000)
                    .skipType(2)
                    .skipContent("https://www.baidu.com")
                    .networkType(-1)
                    .requestId("16214127740408382238160")
                    .pushMode(1)
                    .build();
            Result resultMessage = sender.sendSingle(singleMessage);
            System.out.println(resultMessage);
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}