From cd27d47f4b497c509d91247cfd76e6dd164e2277 Mon Sep 17 00:00:00 2001 From: Philipp Heckel Date: Fri, 20 May 2022 15:59:58 -0400 Subject: [PATCH] APNs data --- server/server_firebase.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/server/server_firebase.go b/server/server_firebase.go index ffd6dd59..4bcbfd27 100644 --- a/server/server_firebase.go +++ b/server/server_firebase.go @@ -3,12 +3,13 @@ package server import ( "context" "encoding/json" + "fmt" + "strings" + firebase "firebase.google.com/go" "firebase.google.com/go/messaging" - "fmt" "google.golang.org/api/option" "heckel.io/ntfy/auth" - "strings" ) const ( @@ -111,8 +112,13 @@ func toFirebaseMessage(m *message, auther auth.Auther) (*messaging.Message, erro data["attachment_expires"] = fmt.Sprintf("%d", m.Attachment.Expires) data["attachment_url"] = m.Attachment.URL } + apnsData := make(map[string]interface{}) + for k, v := range data { + apnsData[k] = v + } apnsConfig = &messaging.APNSConfig{ Payload: &messaging.APNSPayload{ + CustomData: apnsData, Aps: &messaging.Aps{ MutableContent: true, Alert: &messaging.ApsAlert{