From 106989089bf16040ad6580646cc35ee9035edce3 Mon Sep 17 00:00:00 2001 From: shuuy <18211804534@163.com> Date: Tue, 15 Feb 2022 11:42:23 +0800 Subject: [PATCH] =?UTF-8?q?ios=E5=9C=A8=E7=BA=BF=E5=A2=9E=E5=8A=A0title?= =?UTF-8?q?=E5=92=8Ccontent=E7=BB=99=E5=89=8D=E7=AB=AF=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E5=88=9B=E5=BB=BA=E6=B6=88=E6=81=AF=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=EF=BC=8C=E7=A6=BB=E7=BA=BF=E5=A2=9E=E5=8A=A0payload=E6=8F=90?= =?UTF-8?q?=E4=BE=9B=E7=BB=99=E5=89=8D=E7=AB=AF=E5=A4=84=E7=90=86=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/club/uni/service/PushService.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/club/uni/service/PushService.java b/src/main/java/com/club/uni/service/PushService.java index cefdef3..b187a6b 100644 --- a/src/main/java/com/club/uni/service/PushService.java +++ b/src/main/java/com/club/uni/service/PushService.java @@ -94,6 +94,10 @@ public class PushService { */ Strategy strategy=new Strategy(); strategy.setDef(1); + /** + * ios通道策略1-4,表示含义同上,要推送ios通道,需要在个推开发者中心上传ios证书,建议填写2或4,否则可能会有消息不展示的问题 + */ + strategy.setIos(4); Settings settings=new Settings(); settings.setStrategy(strategy); pushDTO.setSettings(settings); @@ -111,6 +115,7 @@ public class PushService { aps.setSound("default"); aps.setAlert(alert); IosDTO iosDTO = new IosDTO(); + iosDTO.setPayload(JSON.toJSONString(jsonObject)); iosDTO.setAps(aps); iosDTO.setType("notify"); pushChannel.setIos(iosDTO); @@ -167,6 +172,8 @@ public class PushService { JSONObject jsonObject = new JSONObject(); jsonObject.put("path",pushUni.getPath()); notification.setClickType("payload"); + jsonObject.put("showTitle", pushUni.getTitle()); + jsonObject.put("showContent", pushUni.getContent()); notification.setPayload(JSON.toJSONString(jsonObject)); Audience audience = new Audience(); pushDTO.setAudience(audience); -- Gitee