mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-27 12:08:52 +08:00
push add ios push
This commit is contained in:
parent
3e51e781a6
commit
8085c62774
@ -23,6 +23,8 @@ func JGAccountListPush(accounts []string, content, detailContent, platform strin
|
|||||||
no.SetAlert(content, platform)
|
no.SetAlert(content, platform)
|
||||||
var me requestBody.Message
|
var me requestBody.Message
|
||||||
me.SetMsgContent(detailContent)
|
me.SetMsgContent(detailContent)
|
||||||
|
var o requestBody.Options
|
||||||
|
o.SetApnsProduction(true)
|
||||||
var po requestBody.PushObj
|
var po requestBody.PushObj
|
||||||
po.SetPlatform(&pf)
|
po.SetPlatform(&pf)
|
||||||
po.SetAudience(&au)
|
po.SetAudience(&au)
|
||||||
|
9
internal/push/jpush/requestBody/options.go
Normal file
9
internal/push/jpush/requestBody/options.go
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
package requestBody
|
||||||
|
|
||||||
|
type Options struct {
|
||||||
|
ApnsProduction bool `json:"apns_production,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *Options) SetApnsProduction(c bool) {
|
||||||
|
o.ApnsProduction = c
|
||||||
|
}
|
@ -5,6 +5,7 @@ type PushObj struct {
|
|||||||
Audience interface{} `json:"audience"`
|
Audience interface{} `json:"audience"`
|
||||||
Notification interface{} `json:"notification,omitempty"`
|
Notification interface{} `json:"notification,omitempty"`
|
||||||
Message interface{} `json:"message,omitempty"`
|
Message interface{} `json:"message,omitempty"`
|
||||||
|
Options interface{} `json:"options,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *PushObj) SetPlatform(pf *Platform) {
|
func (p *PushObj) SetPlatform(pf *Platform) {
|
||||||
@ -22,3 +23,6 @@ func (p *PushObj) SetNotification(no *Notification) {
|
|||||||
func (p *PushObj) SetMessage(m *Message) {
|
func (p *PushObj) SetMessage(m *Message) {
|
||||||
p.Message = m
|
p.Message = m
|
||||||
}
|
}
|
||||||
|
func (p *PushObj) SetOptions(o *Options) {
|
||||||
|
p.Options = o
|
||||||
|
}
|
||||||
|
@ -98,9 +98,9 @@ func MsgToUser(sendPbData *pbRelay.MsgToUserReq, OfflineInfo string, Options map
|
|||||||
}
|
}
|
||||||
pushResult, err := push.JGAccountListPush(UIDList, content, jsonCustomContent, constant.PlatformIDToName(t))
|
pushResult, err := push.JGAccountListPush(UIDList, content, jsonCustomContent, constant.PlatformIDToName(t))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewError(sendPbData.OperationID, "offline push error", sendPbData.String(), err.Error(), t)
|
log.NewError(sendPbData.OperationID, "offline push error", sendPbData.String(), err.Error(), constant.PlatformIDToName(t))
|
||||||
} else {
|
} else {
|
||||||
log.NewDebug(sendPbData.OperationID, "offline push return result is ", string(pushResult), sendPbData, t)
|
log.NewDebug(sendPbData.OperationID, "offline push return result is ", string(pushResult), sendPbData, constant.PlatformIDToName(t))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user