use of cn.cerc.jdb.jiguang.JiguangPush in project summer-mis by cn-cerc.
the class JPushRecord method send.
public void send(IHandle handle) {
LocalService svr = new LocalService(handle, "SvrUserLogin.getMachInfo");
if (!svr.exec("CorpNo_", corpNo, "UserCode_", userCode)) {
throw new RuntimeException(svr.getMessage());
}
// 设置极光推送平台
JiguangPush push = new JiguangPush(handle);
push.setMessage(alert);
push.setMsgId("" + msgId);
push.setTitle(title);
// 将消息推送到极光平台
DataSet dataOut = svr.getDataOut();
while (dataOut.fetch()) {
String machineCode = dataOut.getString("MachineCode_");
int machineType = dataOut.getInt("MachineType_");
switch(machineType) {
case 6:
push.send(ClientType.IOS, machineCode);
break;
case 7:
// 过滤掉没有注册IMEI码的移动设备
if (!"n_null".equals(machineCode) && !"n_000000000000000".equals(machineCode)) {
push.send(ClientType.Android, machineCode);
}
break;
default:
break;
}
}
}
Aggregations