mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-24 02:16:16 +08:00
singal offline push
This commit is contained in:
parent
2b25fea86c
commit
1fffd36054
@ -34,12 +34,12 @@ func (j *JPush) SetAlias(cid, alias string) (resp string, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (j *JPush) Push(accounts []string, alert, detailContent, operationID string, opts push.PushOpts) (string, error) {
|
func (j *JPush) Push(accounts []string, alert, detailContent, operationID string, opts push.PushOpts) (string, error) {
|
||||||
|
|
||||||
var pf requestBody.Platform
|
var pf requestBody.Platform
|
||||||
pf.SetAll()
|
pf.SetAll()
|
||||||
var au requestBody.Audience
|
var au requestBody.Audience
|
||||||
au.SetAlias(accounts)
|
au.SetAlias(accounts)
|
||||||
var no requestBody.Notification
|
var no requestBody.Notification
|
||||||
no.SetAlert(alert)
|
|
||||||
|
|
||||||
var extras requestBody.Extras
|
var extras requestBody.Extras
|
||||||
if opts.Signal.ClientMsgID != "" {
|
if opts.Signal.ClientMsgID != "" {
|
||||||
@ -47,6 +47,7 @@ func (j *JPush) Push(accounts []string, alert, detailContent, operationID string
|
|||||||
}
|
}
|
||||||
no.IOSEnableMutableContent()
|
no.IOSEnableMutableContent()
|
||||||
no.SetExtras(extras)
|
no.SetExtras(extras)
|
||||||
|
no.SetAlert(alert)
|
||||||
var me requestBody.Message
|
var me requestBody.Message
|
||||||
me.SetMsgContent(detailContent)
|
me.SetMsgContent(detailContent)
|
||||||
var o requestBody.Options
|
var o requestBody.Options
|
||||||
|
@ -104,6 +104,8 @@ func MsgToUser(pushMsg *pbPush.PushMsgReq) {
|
|||||||
} else {
|
} else {
|
||||||
content = constant.ContentType2PushContent[constant.GroupMsg]
|
content = constant.ContentType2PushContent[constant.GroupMsg]
|
||||||
}
|
}
|
||||||
|
case constant.SignalingNotification:
|
||||||
|
content = constant.ContentType2PushContent[constant.SignalMsg]
|
||||||
default:
|
default:
|
||||||
content = constant.ContentType2PushContent[constant.Common]
|
content = constant.ContentType2PushContent[constant.Common]
|
||||||
}
|
}
|
||||||
|
@ -419,6 +419,11 @@ type config struct {
|
|||||||
OfflinePush POfflinePush `yaml:"offlinePush"`
|
OfflinePush POfflinePush `yaml:"offlinePush"`
|
||||||
DefaultTips PDefaultTips `yaml:"defaultTips"`
|
DefaultTips PDefaultTips `yaml:"defaultTips"`
|
||||||
} `yaml:"joinDepartmentNotification"`
|
} `yaml:"joinDepartmentNotification"`
|
||||||
|
Signal struct {
|
||||||
|
OfflinePush struct {
|
||||||
|
Title string `yaml:"title"`
|
||||||
|
} `yaml:"offlinePush"`
|
||||||
|
} `yaml:"signal"`
|
||||||
}
|
}
|
||||||
Demo struct {
|
Demo struct {
|
||||||
Port []int `yaml:"openImDemoPort"`
|
Port []int `yaml:"openImDemoPort"`
|
||||||
|
@ -44,6 +44,7 @@ const (
|
|||||||
Quote = 114
|
Quote = 114
|
||||||
Common = 200
|
Common = 200
|
||||||
GroupMsg = 201
|
GroupMsg = 201
|
||||||
|
SignalMsg = 202
|
||||||
|
|
||||||
//SysRelated
|
//SysRelated
|
||||||
NotificationBegin = 1000
|
NotificationBegin = 1000
|
||||||
@ -220,6 +221,7 @@ var ContentType2PushContent = map[int64]string{
|
|||||||
AtText: "[有人@你]",
|
AtText: "[有人@你]",
|
||||||
GroupMsg: "你收到一条群聊消息",
|
GroupMsg: "你收到一条群聊消息",
|
||||||
Common: "你收到一条新消息",
|
Common: "你收到一条新消息",
|
||||||
|
SignalMsg: "音視頻通話邀請",
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user