aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/notificators/NotificatorFirebase.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/notificators/NotificatorFirebase.java')
-rw-r--r--src/main/java/org/traccar/notificators/NotificatorFirebase.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/main/java/org/traccar/notificators/NotificatorFirebase.java b/src/main/java/org/traccar/notificators/NotificatorFirebase.java
index 3f1667568..5787b7ef2 100644
--- a/src/main/java/org/traccar/notificators/NotificatorFirebase.java
+++ b/src/main/java/org/traccar/notificators/NotificatorFirebase.java
@@ -23,7 +23,6 @@ import org.traccar.model.Event;
import org.traccar.model.Position;
import org.traccar.model.User;
import org.traccar.notification.NotificationFormatter;
-import org.traccar.session.cache.CacheManager;
import javax.inject.Inject;
import javax.ws.rs.client.Client;
@@ -31,7 +30,7 @@ import javax.ws.rs.client.Entity;
public class NotificatorFirebase implements Notificator {
- private final CacheManager cacheManager;
+ private final NotificationFormatter notificationFormatter;
private final Client client;
private final String url;
@@ -54,14 +53,15 @@ public class NotificatorFirebase implements Notificator {
}
@Inject
- public NotificatorFirebase(Config config, CacheManager cacheManager, Client client) {
+ public NotificatorFirebase(Config config, NotificationFormatter notificationFormatter, Client client) {
this(
- cacheManager, client, "https://fcm.googleapis.com/fcm/send",
+ notificationFormatter, client, "https://fcm.googleapis.com/fcm/send",
config.getString(Keys.NOTIFICATOR_FIREBASE_KEY));
}
- protected NotificatorFirebase(CacheManager cacheManager, Client client, String url, String key) {
- this.cacheManager = cacheManager;
+ protected NotificatorFirebase(
+ NotificationFormatter notificationFormatter, Client client, String url, String key) {
+ this.notificationFormatter = notificationFormatter;
this.client = client;
this.url = url;
this.key = key;
@@ -71,7 +71,7 @@ public class NotificatorFirebase implements Notificator {
public void send(User user, Event event, Position position) {
if (user.getAttributes().containsKey("notificationTokens")) {
- var shortMessage = NotificationFormatter.formatMessage(cacheManager, user, event, position, "short");
+ var shortMessage = notificationFormatter.formatMessage(user, event, position, "short");
Notification notification = new Notification();
notification.title = shortMessage.getSubject();