add notification sound payload
This commit is contained in:
parent
9970b02567
commit
0872ce961d
2
model.go
2
model.go
|
@ -16,6 +16,7 @@ type PushRequest struct {
|
||||||
Users []string `json:"users"`
|
Users []string `json:"users"`
|
||||||
Label string `json:"label,omitempty"`
|
Label string `json:"label,omitempty"`
|
||||||
Category string `json:"category,omitempty"`
|
Category string `json:"category,omitempty"`
|
||||||
|
Sound string `json:"sound,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// PushResponse ...
|
// PushResponse ...
|
||||||
|
@ -33,6 +34,7 @@ type pushRequest struct {
|
||||||
Topic string `json:"topic"`
|
Topic string `json:"topic"`
|
||||||
Label string `json:"label"`
|
Label string `json:"label"`
|
||||||
Category string `json:"category"`
|
Category string `json:"category"`
|
||||||
|
Sound string `json:"sound,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Query ...
|
// Query ...
|
||||||
|
|
|
@ -61,6 +61,7 @@ func (c *Client) PushToUsers(payload PushRequest) (requestID string, err error)
|
||||||
Users: payload.Users,
|
Users: payload.Users,
|
||||||
Label: payload.Label,
|
Label: payload.Label,
|
||||||
Category: payload.Category,
|
Category: payload.Category,
|
||||||
|
Sound: payload.Sound,
|
||||||
}
|
}
|
||||||
msg, err := c.natsServer.Request(SubjectPushNotification, toBytes(p))
|
msg, err := c.natsServer.Request(SubjectPushNotification, toBytes(p))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue