mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +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)
|
||||
var me requestBody.Message
|
||||
me.SetMsgContent(detailContent)
|
||||
var o requestBody.Options
|
||||
o.SetApnsProduction(true)
|
||||
var po requestBody.PushObj
|
||||
po.SetPlatform(&pf)
|
||||
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"`
|
||||
Notification interface{} `json:"notification,omitempty"`
|
||||
Message interface{} `json:"message,omitempty"`
|
||||
Options interface{} `json:"options,omitempty"`
|
||||
}
|
||||
|
||||
func (p *PushObj) SetPlatform(pf *Platform) {
|
||||
@ -22,3 +23,6 @@ func (p *PushObj) SetNotification(no *Notification) {
|
||||
func (p *PushObj) SetMessage(m *Message) {
|
||||
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))
|
||||
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 {
|
||||
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