mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +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) {
|
||||
|
||||
var pf requestBody.Platform
|
||||
pf.SetAll()
|
||||
var au requestBody.Audience
|
||||
au.SetAlias(accounts)
|
||||
var no requestBody.Notification
|
||||
no.SetAlert(alert)
|
||||
|
||||
var extras requestBody.Extras
|
||||
if opts.Signal.ClientMsgID != "" {
|
||||
@ -47,6 +47,7 @@ func (j *JPush) Push(accounts []string, alert, detailContent, operationID string
|
||||
}
|
||||
no.IOSEnableMutableContent()
|
||||
no.SetExtras(extras)
|
||||
no.SetAlert(alert)
|
||||
var me requestBody.Message
|
||||
me.SetMsgContent(detailContent)
|
||||
var o requestBody.Options
|
||||
|
@ -104,6 +104,8 @@ func MsgToUser(pushMsg *pbPush.PushMsgReq) {
|
||||
} else {
|
||||
content = constant.ContentType2PushContent[constant.GroupMsg]
|
||||
}
|
||||
case constant.SignalingNotification:
|
||||
content = constant.ContentType2PushContent[constant.SignalMsg]
|
||||
default:
|
||||
content = constant.ContentType2PushContent[constant.Common]
|
||||
}
|
||||
|
@ -419,6 +419,11 @@ type config struct {
|
||||
OfflinePush POfflinePush `yaml:"offlinePush"`
|
||||
DefaultTips PDefaultTips `yaml:"defaultTips"`
|
||||
} `yaml:"joinDepartmentNotification"`
|
||||
Signal struct {
|
||||
OfflinePush struct {
|
||||
Title string `yaml:"title"`
|
||||
} `yaml:"offlinePush"`
|
||||
} `yaml:"signal"`
|
||||
}
|
||||
Demo struct {
|
||||
Port []int `yaml:"openImDemoPort"`
|
||||
|
@ -44,6 +44,7 @@ const (
|
||||
Quote = 114
|
||||
Common = 200
|
||||
GroupMsg = 201
|
||||
SignalMsg = 202
|
||||
|
||||
//SysRelated
|
||||
NotificationBegin = 1000
|
||||
@ -212,14 +213,15 @@ const (
|
||||
)
|
||||
|
||||
var ContentType2PushContent = map[int64]string{
|
||||
Picture: "[图片]",
|
||||
Voice: "[语音]",
|
||||
Video: "[视频]",
|
||||
File: "[文件]",
|
||||
Text: "你收到了一条文本消息",
|
||||
AtText: "[有人@你]",
|
||||
GroupMsg: "你收到一条群聊消息",
|
||||
Common: "你收到一条新消息",
|
||||
Picture: "[图片]",
|
||||
Voice: "[语音]",
|
||||
Video: "[视频]",
|
||||
File: "[文件]",
|
||||
Text: "你收到了一条文本消息",
|
||||
AtText: "[有人@你]",
|
||||
GroupMsg: "你收到一条群聊消息",
|
||||
Common: "你收到一条新消息",
|
||||
SignalMsg: "音視頻通話邀請",
|
||||
}
|
||||
|
||||
const (
|
||||
|
Loading…
x
Reference in New Issue
Block a user