mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
getui
This commit is contained in:
parent
e0d612c92f
commit
81a6e4b46c
@ -53,8 +53,9 @@ type PushReq struct {
|
|||||||
Audience struct {
|
Audience struct {
|
||||||
Cid []string `json:"cid"`
|
Cid []string `json:"cid"`
|
||||||
} `json:"audience"`
|
} `json:"audience"`
|
||||||
PushMssage struct {
|
PushMessage struct {
|
||||||
Notification Notification `json:"notification"`
|
Notification Notification `json:"notification,omitempty"`
|
||||||
|
Transmission string `json:"transmission,omitempty"`
|
||||||
} `json:"push_message"`
|
} `json:"push_message"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,8 +63,8 @@ type Notification struct {
|
|||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
Body string `json:"body"`
|
Body string `json:"body"`
|
||||||
ClickType string `json:"click_type"`
|
ClickType string `json:"click_type"`
|
||||||
Intent string `json:"intent"`
|
//Intent string `json:"intent,omitempty"`
|
||||||
Url string `json:"url"`
|
//Url string `json:"url,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type PushResp struct {
|
type PushResp struct {
|
||||||
@ -96,14 +97,10 @@ func (g *Getui) Push(userIDList []string, alert, detailContent, platform, operat
|
|||||||
Cid []string `json:"cid"`
|
Cid []string `json:"cid"`
|
||||||
}{Cid: []string{userIDList[0]}},
|
}{Cid: []string{userIDList[0]}},
|
||||||
}
|
}
|
||||||
pushReq.PushMssage.Notification = Notification{
|
pushReq.PushMessage.Notification = Notification{
|
||||||
Title: alert,
|
Title: alert,
|
||||||
Body: alert,
|
Body: alert,
|
||||||
ClickType: "none",
|
ClickType: "startapp",
|
||||||
}
|
|
||||||
if config.Config.Push.Getui.Intent != "" {
|
|
||||||
pushReq.PushMssage.Notification.Intent = config.Config.Push.Getui.Intent
|
|
||||||
pushReq.PushMssage.Notification.ClickType = "intent"
|
|
||||||
}
|
}
|
||||||
pushResp := PushResp{}
|
pushResp := PushResp{}
|
||||||
err = g.request(PushURL, pushReq, token, &pushResp, operationID)
|
err = g.request(PushURL, pushReq, token, &pushResp, operationID)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user