mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 03:29:16 +00:00
fix for silent iOS notifications (thank you @hnt3b453)
This commit is contained in:
parent
fc0d6a82df
commit
bd6abfc218
@ -11,6 +11,7 @@ import (
|
|||||||
type Payload struct {
|
type Payload struct {
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
Body string `json:"body"`
|
Body string `json:"body"`
|
||||||
|
Sound string `json:"sound"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Message struct {
|
type Message struct {
|
||||||
@ -58,7 +59,7 @@ func SendPushEvent(account store.Account, event string) {
|
|||||||
rows.Scan(&pushToken, &messageTitle, &messageBody)
|
rows.Scan(&pushToken, &messageTitle, &messageBody)
|
||||||
|
|
||||||
url := "https://fcm.googleapis.com/fcm/send"
|
url := "https://fcm.googleapis.com/fcm/send"
|
||||||
payload := Payload{ Title: messageTitle, Body: messageBody };
|
payload := Payload{ Title: messageTitle, Body: messageBody, Sound: "default" };
|
||||||
message := Message{ Notification: payload, To: pushToken };
|
message := Message{ Notification: payload, To: pushToken };
|
||||||
|
|
||||||
body, err := json.Marshal(message)
|
body, err := json.Marshal(message)
|
||||||
|
Loading…
Reference in New Issue
Block a user