From be748d89817e2ccc89ffa439afc87c162fe72868 Mon Sep 17 00:00:00 2001 From: koalasat Date: Sun, 14 Jul 2024 18:57:27 +0200 Subject: [PATCH] Better sentence and interactive permanent notification --- .../src/main/java/com/robosats/NotificationsService.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mobile/android/app/src/main/java/com/robosats/NotificationsService.java b/mobile/android/app/src/main/java/com/robosats/NotificationsService.java index 771d06f2..c95d4d3f 100644 --- a/mobile/android/app/src/main/java/com/robosats/NotificationsService.java +++ b/mobile/android/app/src/main/java/com/robosats/NotificationsService.java @@ -110,14 +110,19 @@ public class NotificationsService extends Service { } private Notification buildServiceNotification() { + Intent intent = new Intent(this, MainActivity.class); + intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); + PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_IMMUTABLE); + NotificationCompat.Builder builder = new NotificationCompat.Builder(this, CHANNEL_ID) .setContentTitle("Tor Notifications") - .setContentText("The app will run in the background to send notifications about your orders.") + .setContentText("Running in the background to check every 5 minutes for notifications.") .setSmallIcon(R.mipmap.ic_icon) .setTicker("Robosats") .setPriority(NotificationCompat.PRIORITY_MIN) .setOngoing(true) - .setAutoCancel(false); + .setAutoCancel(false) + .setContentIntent(pendingIntent); return builder.build(); }