Skip to content

Commit 5c22c34

Browse files
committed
fix: Replace low-importance drawer notifications with in-app alerts
Replaces low-priority drawer notifications with in-app alerts using Capacitor's Dialog plugin (or a browser alert as a fallback).
1 parent ed23381 commit 5c22c34

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ android {
77
applicationId "com.notask.app"
88
minSdkVersion rootProject.ext.minSdkVersion
99
targetSdkVersion rootProject.ext.targetSdkVersion
10-
versionCode 1518011
11-
versionName "15.18.11"
10+
versionCode 1518012
11+
versionName "15.18.12"
1212
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1313
aaptOptions {
1414
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"type": "module",
33
"name": "my-notes-and-tasks-modern",
4-
"version": "15.18.11",
4+
"version": "15.18.12",
55
"private": true,
66
"license": "Licensed CC BY-ND 4.0. No derivatives allowed.",
77
"scripts": {

src/services/notificationService.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,22 @@ class NotificationService {
8888
LocalNotifications.cancel({ notifications: [{ id: notificationId }] });
8989
}
9090

91-
// Schedule a low-importance drawer notification instead
91+
// Show in-app alert instead
9292
const extra = notification?.extra || notification?.notification?.extra;
93-
if (extra && extra.itemId) {
94-
this.scheduleDrawerNotification({
95-
itemId: extra.itemId,
96-
timestamp: Date.now(),
97-
itemTitle: extra.originalReminder?.itemTitle || 'Untitled',
98-
originalReminder: extra.originalReminder
93+
const itemTitle = extra?.originalReminder?.itemTitle || extra?.itemTitle || notification.body?.replace("Don't forget: ", "") || 'Untitled';
94+
95+
console.log('🔔 Showing in-app reminder alert for:', itemTitle);
96+
97+
// Show native alert dialog
98+
if (window.Capacitor?.Plugins?.Dialog) {
99+
window.Capacitor.Plugins.Dialog.alert({
100+
title: '⏰ Reminder',
101+
message: `Don't forget: ${itemTitle}`,
102+
buttonTitle: 'OK'
99103
});
104+
} else {
105+
// Fallback to browser alert
106+
alert(`⏰ Reminder: Don't forget: ${itemTitle}`);
100107
}
101108
}
102109
});

0 commit comments

Comments
 (0)