From ebd5fce6789949020c1c5ba03b6f237ffe3a7159 Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Tue, 27 Jul 2021 15:25:22 -0400 Subject: [PATCH] Add custom field with account list --- internal/api/devices.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/api/devices.go b/internal/api/devices.go index f20428b..15ab5b9 100644 --- a/internal/api/devices.go +++ b/internal/api/devices.go @@ -5,6 +5,7 @@ import ( "encoding/json" "fmt" "net/http" + "strings" "github.com/dustin/go-humanize/english" "github.com/julienschmidt/httprouter" @@ -67,13 +68,14 @@ func (a *api) testDeviceHandler(w http.ResponseWriter, r *http.Request, ps httpr users = append(users, user) } - body := fmt.Sprintf("Active usernames are: %s", english.OxfordWordSeries(users, "and")) + body := fmt.Sprintf("Active usernames are: %s. Tap me for more info!", english.OxfordWordSeries(users, "and")) notification := &apns2.Notification{} notification.Topic = "com.christianselig.Apollo" notification.DeviceToken = d.APNSToken notification.Payload = payload. NewPayload(). Category("test-notification"). + Custom("test_accounts", strings.Join(users, ",")). AlertTitle(notificationTitle). AlertBody(body)