fix: notification title fix
This commit is contained in:
@@ -220,17 +220,23 @@ func (s *NotificationService) publishPush(ctx context.Context, recipientID, kind
|
|||||||
who = actorDisplay(actor)
|
who = actorDisplay(actor)
|
||||||
url = s.frontendURL + "/u/" + actor.Handle
|
url = s.frontendURL + "/u/" + actor.Handle
|
||||||
}
|
}
|
||||||
var body string
|
// Title must be meaningful, not the app name: iOS renders installed-PWA
|
||||||
|
// notifications as "<title> from <app name>", so a generic "Prabhupāda
|
||||||
|
// Says" title reads as "Prabhupāda Says from Prabhupāda Says".
|
||||||
|
var title, body string
|
||||||
switch kind {
|
switch kind {
|
||||||
case NotifFollowRequest:
|
case NotifFollowRequest:
|
||||||
|
title = "New Friend Request"
|
||||||
body = who + " requested to follow you"
|
body = who + " requested to follow you"
|
||||||
case NotifFollowAccepted:
|
case NotifFollowAccepted:
|
||||||
|
title = "Friend Request Accepted"
|
||||||
body = who + " accepted your follow request"
|
body = who + " accepted your follow request"
|
||||||
default:
|
default:
|
||||||
|
title = "New notification"
|
||||||
body = "You have a new notification"
|
body = "You have a new notification"
|
||||||
}
|
}
|
||||||
s.push.SendToUser(ctx, recipientID, PushPayload{
|
s.push.SendToUser(ctx, recipientID, PushPayload{
|
||||||
Title: "Prabhupāda Says",
|
Title: title,
|
||||||
Body: body,
|
Body: body,
|
||||||
URL: url,
|
URL: url,
|
||||||
Tag: kind,
|
Tag: kind,
|
||||||
|
|||||||
Reference in New Issue
Block a user