Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Working on mobile console notification

Mica Halline1bf0881cda0
diff --git a/console/android/src/main/java/org/openremote/android/ORFirebaseMessagingService.java b/console/android/src/main/java/org/openremote/android/ORFirebaseMessagingService.java
index 42fb5e43a..c882ebf23 100644
--- a/console/android/src/main/java/org/openremote/android/ORFirebaseMessagingService.java
+++ b/console/android/src/main/java/org/openremote/android/ORFirebaseMessagingService.java
@@ -8,7 +8,6 @@ import android.content.SharedPreferences;
import android.media.RingtoneManager;
import android.net.Uri;
import android.preference.PreferenceManager;
-import android.service.notification.StatusBarNotification;
import android.support.v4.app.NotificationCompat;
import android.util.Log;
@@ -18,7 +17,6 @@ import org.openremote.android.service.AlertAction;
import org.openremote.android.service.AlertNotification;
import org.openremote.android.service.TokenService;
-import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -121,7 +119,7 @@ public class ORFirebaseMessagingService extends com.google.firebase.messaging.Fi
.setSound(defaultSoundUri);
for (AlertAction alertAction : alertNotification.getActions()) {
- notificationBuilder = notificationBuilder.addAction(new NotificationCompat.Action(-1, alertAction.getName(), pendingIntent));
+ notificationBuilder = notificationBuilder.addAction(new NotificationCompat.Action(-1, alertAction.getTitle(), pendingIntent));
}
NotificationManager notificationManager =
diff --git a/console/android/src/main/java/org/openremote/android/service/AlertAction.java b/console/android/src/main/java/org/openremote/android/service/AlertAction.java
index 5f22d0778..63cdf6ddb 100644
--- a/console/android/src/main/java/org/openremote/android/service/AlertAction.java
+++ b/console/android/src/main/java/org/openremote/android/service/AlertAction.java
@@ -3,7 +3,7 @@ package org.openremote.android.service;
public class AlertAction {
private AlertNotification.ActionType type;
- private String name;
+ private String title;
public AlertAction() {
}
@@ -16,19 +16,19 @@ public class AlertAction {
this.type = type;
}
- public String getName() {
- return name;
+ public String getTitle() {
+ return title;
}
- public void setName(String name) {
- this.name = name;
+ public void setTitle(String title) {
+ this.title = title;
}
@Override
public String toString() {
return "AlertAction{" +
"type=" + type +
- ", name='" + name + '\'' +
+ ", title='" + title + '\'' +
'}';
}
}
\ No newline at end of file
diff --git a/manager/test/src/test/groovy/org/openremote/test/user/NotificationServiceTest.groovy b/manager/test/src/test/groovy/org/openremote/test/user/NotificationServiceTest.groovy
index 0a21700ca..60c5ae12d 100644
--- a/manager/test/src/test/groovy/org/openremote/test/user/NotificationServiceTest.groovy
+++ b/manager/test/src/test/groovy/org/openremote/test/user/NotificationServiceTest.groovy
@@ -3,9 +3,9 @@ package org.openremote.test.user
import org.openremote.manager.server.setup.SetupService
import org.openremote.manager.server.setup.builtin.KeycloakDemoSetup
import org.openremote.manager.server.notification.NotificationService
-import org.openremote.manager.shared.notification.ActionType
-import org.openremote.manager.shared.notification.AlertAction
-import org.openremote.manager.shared.notification.AlertNotification
+import org.openremote.model.notification.ActionType
+import org.openremote.model.notification.AlertAction
+import org.openremote.model.notification.AlertNotification
import org.openremote.manager.shared.notification.NotificationResource
import org.openremote.test.ManagerContainerTrait
import spock.lang.Specification