change notification title

This commit is contained in:
Andre Medeiros 2021-07-26 13:42:16 -04:00
parent e39693d47b
commit 8723bf6c5c

View file

@ -15,6 +15,8 @@ import (
"github.com/christianselig/apollo-backend/internal/data" "github.com/christianselig/apollo-backend/internal/data"
) )
const notificationTitle = "📣 Hello, is this thing on?"
func (a *api) upsertDeviceHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { func (a *api) upsertDeviceHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
d := &data.Device{} d := &data.Device{}
if err := json.NewDecoder(r.Body).Decode(d); err != nil { if err := json.NewDecoder(r.Body).Decode(d); err != nil {
@ -72,7 +74,7 @@ func (a *api) testDeviceHandler(w http.ResponseWriter, r *http.Request, ps httpr
notification.Payload = payload. notification.Payload = payload.
NewPayload(). NewPayload().
Category("test-notification"). Category("test-notification").
AlertTitle("Test notification"). AlertTitle(notificationTitle).
AlertBody(body) AlertBody(body)
client := apns2.NewTokenClient(a.apns) client := apns2.NewTokenClient(a.apns)