mirror of
https://github.com/binwiederhier/ntfy.git
synced 2024-12-15 17:50:55 +00:00
Only send Firebase data messages
This commit is contained in:
parent
4b455e0fd8
commit
9a91312392
1 changed files with 2 additions and 7 deletions
|
@ -105,19 +105,14 @@ func createFirebaseSubscriber(conf *config.Config) (subscriber, error) {
|
||||||
}
|
}
|
||||||
return func(m *message) error {
|
return func(m *message) error {
|
||||||
_, err := msg.Send(context.Background(), &messaging.Message{
|
_, err := msg.Send(context.Background(), &messaging.Message{
|
||||||
|
Topic: m.Topic,
|
||||||
Data: map[string]string{
|
Data: map[string]string{
|
||||||
"id": m.ID,
|
"id": m.ID,
|
||||||
"time": fmt.Sprintf("%d", m.Time),
|
"time": fmt.Sprintf("%d", m.Time),
|
||||||
"event": m.Event,
|
"event": m.Event,
|
||||||
"topic": m.Topic,
|
"topic": m.Topic,
|
||||||
"message": m.Message,
|
"message": m.Message,
|
||||||
},
|
},
|
||||||
Notification: &messaging.Notification{
|
|
||||||
Title: m.Topic, // FIXME convert to ntfy.sh/$topic instead
|
|
||||||
Body: m.Message,
|
|
||||||
ImageURL: "",
|
|
||||||
},
|
|
||||||
Topic: m.Topic,
|
|
||||||
})
|
})
|
||||||
return err
|
return err
|
||||||
}, nil
|
}, nil
|
||||||
|
|
Loading…
Reference in a new issue