add notification sound payload

This commit is contained in:
Sinh 2021-12-21 17:22:42 +07:00
parent 9970b02567
commit 0872ce961d
2 changed files with 3 additions and 0 deletions

View File

@ -16,6 +16,7 @@ type PushRequest struct {
Users []string `json:"users"`
Label string `json:"label,omitempty"`
Category string `json:"category,omitempty"`
Sound string `json:"sound,omitempty"`
}
// PushResponse ...
@ -33,6 +34,7 @@ type pushRequest struct {
Topic string `json:"topic"`
Label string `json:"label"`
Category string `json:"category"`
Sound string `json:"sound,omitempty"`
}
// Query ...

View File

@ -61,6 +61,7 @@ func (c *Client) PushToUsers(payload PushRequest) (requestID string, err error)
Users: payload.Users,
Label: payload.Label,
Category: payload.Category,
Sound: payload.Sound,
}
msg, err := c.natsServer.Request(SubjectPushNotification, toBytes(p))
if err != nil {