From 85a75be30e5ffb001c0cb6519ead7e558ed2b8e3 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 12 Nov 2021 16:09:21 +0800 Subject: [PATCH] notification modify --- internal/push/jpush/push.go | 1 + internal/push/jpush/requestBody/notification.go | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/push/jpush/push.go b/internal/push/jpush/push.go index b2cf95d9a..2fe39c27f 100644 --- a/internal/push/jpush/push.go +++ b/internal/push/jpush/push.go @@ -21,6 +21,7 @@ func JGAccountListPush(accounts []string, content, detailContent, platform strin au.SetAlias(accounts) var no requestBody.Notification no.SetAlert(content) + no.SetAndroidIntent() var me requestBody.Message me.SetMsgContent(detailContent) var po requestBody.PushObj diff --git a/internal/push/jpush/requestBody/notification.go b/internal/push/jpush/requestBody/notification.go index 192803353..bbb4bb927 100644 --- a/internal/push/jpush/requestBody/notification.go +++ b/internal/push/jpush/requestBody/notification.go @@ -1,5 +1,7 @@ package requestBody +const INTENT_URL = "intent:#Intent;component=io.openim.app.enterprisechat/io.openim.app.enterprisechat.MainActivity;end" + type Notification struct { Alert string `json:"alert,omitempty"` Android *Android `json:"android,omitempty"` @@ -7,11 +9,14 @@ type Notification struct { } type Android struct { + Intent string `json:"intent,omitempty"` } - type Ios struct { } func (n *Notification) SetAlert(alert string) { n.Alert = alert } +func (n *Notification) SetAndroidIntent() { + n.Android.Intent = INTENT_URL +}