package cn.cerc.db.jiguang;

import cn.cerc.core.TDateTime;
import cn.cerc.db.core.StubHandleText;
import lombok.extern.slf4j.Slf4j;
import org.junit.Before;
import org.junit.Test;

@Slf4j
public class JiguangPushTest {
    private static final String sound = "trade_mall.wav";
    private StubHandleText handle;

    @Before
    public void setUp() throws Exception {
        handle = new StubHandleText();
    }

    @Test
    public void test() {
        // 初始化极光推送
        JiguangPush push = new JiguangPush(handle);

        // 消息标题，仅安卓机型有效，IOS设备忽略
        push.setTitle("消息推送测试");

        // 通知栏消息内容
        String message = TDateTime.now().toString() + "这是系统向您发送的测试消息，如有打扰，请您忽略，谢谢！";
        log.info(message);
        push.setMessage(message);

        // 附加的消息id
        push.setMsgId("3707");

        // 发送给指定的设备Id
        push.send(ClientType.Android, "n_e201ff3670a4174b");// itjun-xiaomi-mix2
        push.send(ClientType.Android, "n_a86ddf4df465a83f");// weibo-xiaomi-5c
        push.send(ClientType.IOS, "i_0C005500702F4F97AD81C2E992E36108");// ly-iPhone-SE2
        push.send(ClientType.IOS, "i_A1688A8910B04499ABC64B035B559921");// wsg-iPhone-xr
        push.send(ClientType.IOS, "i_87E2C6FB4D2347F49FC17CD564B07AEE");// itjun-iPhone-SE2
//        push.send(ClientType.IOS, "i_87E2C6FB4D2347F49FC17CD564B07AEE", sound);// HuangRongjun-iPhone

        // 发送给指定的设备类型
        // push.send(ClientType.IOS, null);
        // push.send(ClientType.Android, null);

        // 发送给所有的用户
        // push.send();
    }

}

@@ -820,16 +820,18 @@
 %E6%8C%87%E5%AE%9A%E7%9A%84%E8%AE%BE%E5%A4%87Id%0A
+//
         
@@ -867,24 +867,24 @@
  %22n_
-e201ff3670a4174b
+f526c72cf13474d7
 %22);/
@@ -903,16 +903,100 @@
 mi-mix2%0A
+        push.send(ClientType.Android, %22n_d4ffa59ea6d1d9f3%22);// joylee-xiaomi-mix2%0A//
         
@@ -1066,16 +1066,18 @@
 aomi-5c%0A
+//
         
@@ -1109,40 +1109,40 @@
  %22i_
-0C005500702F4F97AD81C2E992E36108
+82D7A281FC37497F810085A6D7EFB1B2
 %22);/
@@ -1157,16 +1157,18 @@
 one-SE2%0A
+//
         
@@ -1248,16 +1248,18 @@
 hone-xr%0A
+//
         
@@ -1292,39 +1292,39 @@
 %22i_8
-7E2C6FB4D2347F49FC17CD564B07AEE
+2D7A281FC37497F810085A6D7EFB1B2
 %22);/

Update JiguangPushTest.java