diff --git a/internal/push/jpush/push.go b/internal/push/jpush/push.go index e1f2ea12f..8868c9616 100644 --- a/internal/push/jpush/push.go +++ b/internal/push/jpush/push.go @@ -45,6 +45,7 @@ func (j *JPush) Push(accounts []string, alert, detailContent, operationID string if opts.Signal.ClientMsgID != "" { extras.ClientMsgID = opts.Signal.ClientMsgID } + no.IOSEnableMutableContent() no.SetExtras(extras) var me requestBody.Message me.SetMsgContent(detailContent) diff --git a/internal/push/jpush/requestBody/notification.go b/internal/push/jpush/requestBody/notification.go index 9dd878147..56ada1551 100644 --- a/internal/push/jpush/requestBody/notification.go +++ b/internal/push/jpush/requestBody/notification.go @@ -18,10 +18,11 @@ type Android struct { Extras Extras `json:"extras"` } type Ios struct { - Alert string `json:"alert,omitempty"` - Sound string `json:"sound,omitempty"` - Badge string `json:"badge,omitempty"` - Extras Extras `json:"extras"` + Alert string `json:"alert,omitempty"` + Sound string `json:"sound,omitempty"` + Badge string `json:"badge,omitempty"` + Extras Extras `json:"extras"` + MutableContent bool `json:"mutable-content"` } type Extras struct { @@ -45,3 +46,7 @@ func (n *Notification) SetExtras(extras Extras) { func (n *Notification) SetAndroidIntent() { n.Android.Intent.URL = config.Config.Push.Jpns.PushIntent } + +func (n *Notification) IOSEnableMutableContent() { + n.IOS.MutableContent = true +}