mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-07 10:35:59 +08:00
push update
This commit is contained in:
@@ -32,13 +32,13 @@ func (j *JPush) SetAlias(cid, alias string) (resp string, err error) {
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (j *JPush) Push(accounts []string, alert, detailContent, platform, operationID string) (string, error) {
|
||||
func (j *JPush) Push(accounts []string, alert, detailContent, operationID string) (string, error) {
|
||||
var pf requestBody.Platform
|
||||
_ = pf.SetPlatform(platform)
|
||||
pf.SetAll()
|
||||
var au requestBody.Audience
|
||||
au.SetAlias(accounts)
|
||||
var no requestBody.Notification
|
||||
no.SetAlert(alert, platform)
|
||||
no.SetAlert(alert)
|
||||
var me requestBody.Message
|
||||
me.SetMsgContent(detailContent)
|
||||
var o requestBody.Options
|
||||
|
||||
@@ -2,7 +2,6 @@ package requestBody
|
||||
|
||||
import (
|
||||
"Open_IM/pkg/common/config"
|
||||
"Open_IM/pkg/common/constant"
|
||||
)
|
||||
|
||||
type Notification struct {
|
||||
@@ -23,18 +22,14 @@ type Ios struct {
|
||||
Badge string `json:"badge,omitempty"`
|
||||
}
|
||||
|
||||
func (n *Notification) SetAlert(alert, platform string) {
|
||||
func (n *Notification) SetAlert(alert string) {
|
||||
n.Alert = alert
|
||||
switch platform {
|
||||
case constant.AndroidPlatformStr:
|
||||
n.Android.Alert = alert
|
||||
n.SetAndroidIntent()
|
||||
case constant.IOSPlatformStr:
|
||||
n.IOS.Alert = alert
|
||||
n.IOS.Sound = "default"
|
||||
n.IOS.Badge = "+1"
|
||||
default:
|
||||
}
|
||||
n.Android.Alert = alert
|
||||
n.SetAndroidIntent()
|
||||
n.IOS.Alert = alert
|
||||
n.IOS.Sound = "default"
|
||||
n.IOS.Badge = "+1"
|
||||
|
||||
}
|
||||
func (n *Notification) SetAndroidIntent() {
|
||||
n.Android.Intent.URL = config.Config.Push.Jpns.PushIntent
|
||||
|
||||
Reference in New Issue
Block a user