From 12b26830b3eae6fac9e87c462fc09cfe6c962964 Mon Sep 17 00:00:00 2001 From: Khaksar Weqar Date: Tue, 2 Nov 2021 16:22:03 +0100 Subject: short-message-title-from-templates --- src/main/java/org/traccar/notificators/NotificatorFirebase.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/main/java/org/traccar/notificators/NotificatorFirebase.java') diff --git a/src/main/java/org/traccar/notificators/NotificatorFirebase.java b/src/main/java/org/traccar/notificators/NotificatorFirebase.java index cd084080e..9d1982f9c 100644 --- a/src/main/java/org/traccar/notificators/NotificatorFirebase.java +++ b/src/main/java/org/traccar/notificators/NotificatorFirebase.java @@ -24,7 +24,9 @@ import org.traccar.config.Keys; import org.traccar.model.Event; import org.traccar.model.Position; import org.traccar.model.User; +import org.traccar.notification.FullMessage; import org.traccar.notification.NotificationFormatter; +import org.traccar.notification.ShortMessage; import javax.ws.rs.client.Entity; import javax.ws.rs.client.InvocationCallback; @@ -68,9 +70,11 @@ public class NotificatorFirebase extends Notificator { final User user = Context.getPermissionsManager().getUser(userId); if (user.getAttributes().containsKey("notificationTokens")) { + ShortMessage shortMessage = NotificationFormatter.formatShortMessage(userId, event, position); + Notification notification = new Notification(); - notification.title=Context.getConfig().getString(Keys.NOTIFICATOR_FIREBASE_TITLE); - notification.body = NotificationFormatter.formatShortMessage(userId, event, position).trim(); + notification.title= shortMessage.getTitle(); + notification.body = shortMessage.getBody(); notification.sound = "default"; Message message = new Message(); -- cgit v1.2.3