瀏覽代碼

修改极光推送

anderx 7 年之前
父節點
當前提交
748de23786
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/main/java/com/goafanti/message/JGMessageHelper.java

+ 3 - 0
src/main/java/com/goafanti/message/JGMessageHelper.java

@@ -51,6 +51,7 @@ public class JGMessageHelper implements InitializingBean, DisposableBean{
 	private static final Logger logger = LoggerFactory.getLogger(JGMessageHelper.class);
 	private static final int MAX_TRYCOUNT = 3;
 	private static final String MESSAGE_ID = "message_id";//消息ID
+	private static final String MESSAGE_TITLE = "message_title";//消息ID
 	private static final String MESSAGE_BODY = "message_body";//消息ID
 	private static final String RESOURCE_ID =  "resource_id";//资源ID
 	private static final String RESOURCE_TYPE = "resource_type";//资源类型
@@ -126,6 +127,7 @@ public class JGMessageHelper implements InitializingBean, DisposableBean{
 					.setNotification(Notification.newBuilder()
 			        		.addPlatformNotification(AndroidNotification.newBuilder()
 			        				.addExtra(MESSAGE_ID, mp.getId())
+			        				.addExtra(MESSAGE_TITLE, mp.getTitle())
 			        				.addExtra(MESSAGE_BODY, mp.getBody())
 			        				.addExtra(RESOURCE_ID, mp.getResourceId() == null ? "" : mp.getResourceId())
 			        				.addExtra(RESOURCE_TYPE, mp.getResourceType() == null ? "":mp.getResourceType().toString()).build())
@@ -133,6 +135,7 @@ public class JGMessageHelper implements InitializingBean, DisposableBean{
 			        				.incrBadge(1)
 			        				.setContentAvailable(true)
 			        				.addExtra(MESSAGE_ID, mp.getId())
+			        				.addExtra(MESSAGE_TITLE, mp.getTitle())
 			        				.addExtra(MESSAGE_BODY, mp.getBody())
 			        				.addExtra(RESOURCE_ID, mp.getResourceId() == null ? "" : mp.getResourceId())
 			        				.addExtra(RESOURCE_TYPE, mp.getResourceType()== null ? "": mp.getResourceType().toString()).build())