aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/notificators
diff options
context:
space:
mode:
authorKhaksar Weqar <wkhaksar1@gmail.com>2021-10-22 11:45:35 +0200
committerKhaksar Weqar <wkhaksar1@gmail.com>2021-10-22 11:45:35 +0200
commitf686847115097cf388a775fad6f13b8bf6893193 (patch)
treebe12f99ecf3d292b65a0342f6a8e7eb0f373160f /src/main/java/org/traccar/notificators
parenta4aeff1bbf26e46270212a3a1c17e3ac47d58647 (diff)
downloadtrackermap-server-f686847115097cf388a775fad6f13b8bf6893193.tar.gz
trackermap-server-f686847115097cf388a775fad6f13b8bf6893193.tar.bz2
trackermap-server-f686847115097cf388a775fad6f13b8bf6893193.zip
title-added
Diffstat (limited to 'src/main/java/org/traccar/notificators')
-rw-r--r--src/main/java/org/traccar/notificators/NotificatorFirebase.java21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/main/java/org/traccar/notificators/NotificatorFirebase.java b/src/main/java/org/traccar/notificators/NotificatorFirebase.java
index 78d5da1e2..cd084080e 100644
--- a/src/main/java/org/traccar/notificators/NotificatorFirebase.java
+++ b/src/main/java/org/traccar/notificators/NotificatorFirebase.java
@@ -37,6 +37,8 @@ public class NotificatorFirebase extends Notificator {
private final String key;
public static class Notification {
+ @JsonProperty("title")
+ private String title;
@JsonProperty("body")
private String body;
@JsonProperty("sound")
@@ -67,6 +69,7 @@ public class NotificatorFirebase extends Notificator {
if (user.getAttributes().containsKey("notificationTokens")) {
Notification notification = new Notification();
+ notification.title=Context.getConfig().getString(Keys.NOTIFICATOR_FIREBASE_TITLE);
notification.body = NotificationFormatter.formatShortMessage(userId, event, position).trim();
notification.sound = "default";
@@ -77,15 +80,15 @@ public class NotificatorFirebase extends Notificator {
Context.getClient().target(url).request()
.header("Authorization", "key=" + key)
.async().post(Entity.json(message), new InvocationCallback<Object>() {
- @Override
- public void completed(Object o) {
- }
-
- @Override
- public void failed(Throwable throwable) {
- LOGGER.warn("Firebase notification error", throwable);
- }
- });
+ @Override
+ public void completed(Object o) {
+ }
+
+ @Override
+ public void failed(Throwable throwable) {
+ LOGGER.warn("Firebase notification error", throwable);
+ }
+ });
}
}