Something went wrong. Try again.
An event companion and onboarding experience for the ATmosphere (alpha) atmo.quest
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142package api
import ( "context"
"atmoquest/internal/push")
// notifyBadgeEarned sends a push notification when a user earns a badge.func (h *Handlers) notifyBadgeEarned(did, badgeName string) { if h.Push == nil { return } go h.Push.SendToUser(context.Background(), did, push.Notification{ Title: "badge earned!", Body: "you earned the " + badgeName + " badge", Data: map[string]string{ "route": "/badges", "type": "badge_earned", }, })}
// notifyNewConnection sends a push notification when someone connects with a user.func (h *Handlers) notifyNewConnection(targetDID, fromHandle string) { if h.Push == nil { return } body := "someone connected with you" if fromHandle != "" { body = "@" + fromHandle + " connected with you" } go h.Push.SendToUser(context.Background(), targetDID, push.Notification{ Title: "new connection", Body: body, Data: map[string]string{ "route": "/connections", "type": "new_connection", }, })}