fix: push notification fix

This commit is contained in:
Krispire Admin
2026-06-08 18:42:31 +05:30
parent 29c5f7cee5
commit 1f02ae26f6
+8 -1
View File
@@ -185,7 +185,7 @@ func (s *NotificationService) SendReminder(ctx context.Context, userID, kind, ti
// Web Push (reaches closed apps).
if s.push != nil {
s.push.SendToUser(ctx, userID, PushPayload{Title: title, Body: body, URL: url, Tag: kind, RequireInteraction: true})
s.push.SendToUser(ctx, userID, PushPayload{Title: title, Body: body, URL: url, Icon: s.iconURL(), Tag: kind, RequireInteraction: true})
}
// Email (only if there's an address on file).
@@ -239,10 +239,17 @@ func (s *NotificationService) publishPush(ctx context.Context, recipientID, kind
Title: title,
Body: body,
URL: url,
Icon: s.iconURL(),
Tag: kind,
})
}
// iconURL is the absolute URL of the notification icon (the app's square
// icon), so it renders regardless of the client's base path.
func (s *NotificationService) iconURL() string {
return strings.TrimRight(s.frontendURL, "/") + "/icon-192.png"
}
func (s *NotificationService) render(kind string, recipient, actor *model.User) (string, error) {
data := map[string]any{
"RecipientName": recipient.Name,