保存信息修改

This commit is contained in:
yiyan
2019-05-26 15:30:52 +08:00
parent 7b2c9f46a0
commit 22aa395392
20 changed files with 235 additions and 148 deletions
@@ -27,7 +27,7 @@ public class AliyunPushApiTest {
IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", "LTAIfZaosFH5IWlD", "dvlE8eFii31BcGb8HzkGz3eSaJ6Y94");
DefaultAcsClient client = new DefaultAcsClient(profile);
PushRequest pushRequest = new PushRequest();
pushRequest.setAppKey(23252055l);
pushRequest.setAppKey(26023230l);
pushRequest.setSysProtocol(ProtocolType.HTTPS);
pushRequest.setSysMethod(MethodType.POST);
pushRequest.setStoreOffline(true);
@@ -45,15 +45,21 @@ public class AliyunPushApiTest {
pushRequest.setAcceptFormat(FormatType.JSON);
//根据Target来设定,多个值使用逗号分隔
//此处应该查询出用户所对应的deviceId ★★★★★
pushRequest.setTargetValue("18aujhs872ysgd6tx7329oaliygx7432");
pushRequest.setTargetValue("c17c0590e8254b6b977b8fd7706fa8c2");
//推送类型
pushRequest.setPushType("MESSAGE");
pushRequest.setPushType("NOTICE");
//推送设备类型
pushRequest.setDeviceType("ANDROID");
// 消息的标题
pushRequest.setTitle("温度报警");
// 消息的内容
pushRequest.setBody("[温度报警]你的水族箱\"鱼缸1234\"在2019-04-10 23:40:00,温度达到29℃,已高于28℃,请及时查看!");
// 推送配置: Android
pushRequest.setAndroidNotifyType("BOTH");//通知的提醒方式 "VIBRATE" : 震动 "SOUND" : 声音 "BOTH" : 声音和震动 NONE : 静音
pushRequest.setAndroidOpenType("APPLICATION"); //点击通知后动作 "APPLICATION" : 打开应用 "ACTIVITY" : 打开AndroidActivity "URL" : 打开URL "NONE" : 无跳转
// 指定notificaitonchannel id
pushRequest.setAndroidNotificationChannel("1");
try {
PushResponse response = client.getAcsResponse(pushRequest);
log.info(response);