From 9902e5fac7403b8417d161835c88579afef49225 Mon Sep 17 00:00:00 2001 From: Jose Olarte III Date: Thu, 12 Mar 2026 17:20:45 +0800 Subject: [PATCH] chore: align with daily-notification-plugin 2.0.0 (org.timesafari namespace) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update Android manifest, Java imports, and capacitor.plugins.json to use org.timesafari.dailynotification (receivers, intent action, plugin classpath) - Update iOS Info.plist BGTaskSchedulerPermittedIdentifiers to org.timesafari.* - Bump @timesafari/daily-notification-plugin 1.3.3 → 2.0.0 (package-lock, Podfile.lock) - Update docs and test-notification-receiver.sh to reference new package/action names - Lockfile: minor bumps for @expo/cli, @expo/fingerprint, @expo/router-server, babel-preset-expo --- android/app/src/main/AndroidManifest.xml | 8 ++--- .../src/main/assets/capacitor.plugins.json | 2 +- .../java/app/timesafari/MainActivity.java | 2 +- .../app/timesafari/TimeSafariApplication.java | 4 +-- .../timesafari/TimeSafariNativeFetcher.java | 6 ++-- doc/daily-notification-alignment-outline.md | 2 +- ...ification-plugin-android-receiver-issue.md | 22 ++++++------- ...gin-fix-scheduleExactNotification-calls.md | 20 ++++++------ ...dback-android-post-reboot-fallback-text.md | 2 +- ...-feedback-android-rollover-after-reboot.md | 2 +- ios/App/App/Info.plist | 8 ++--- ios/App/Podfile.lock | 4 +-- package-lock.json | 32 +++++++++---------- scripts/test-notification-receiver.sh | 6 ++-- 14 files changed, 60 insertions(+), 60 deletions(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 239c94ae..69b09a54 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -49,17 +49,17 @@ - + @@ -67,7 +67,7 @@ diff --git a/android/app/src/main/assets/capacitor.plugins.json b/android/app/src/main/assets/capacitor.plugins.json index 721bea0d..4981dd86 100644 --- a/android/app/src/main/assets/capacitor.plugins.json +++ b/android/app/src/main/assets/capacitor.plugins.json @@ -37,6 +37,6 @@ }, { "pkg": "@timesafari/daily-notification-plugin", - "classpath": "com.timesafari.dailynotification.DailyNotificationPlugin" + "classpath": "org.timesafari.dailynotification.DailyNotificationPlugin" } ] diff --git a/android/app/src/main/java/app/timesafari/MainActivity.java b/android/app/src/main/java/app/timesafari/MainActivity.java index a7133e39..e02a3b78 100644 --- a/android/app/src/main/java/app/timesafari/MainActivity.java +++ b/android/app/src/main/java/app/timesafari/MainActivity.java @@ -69,7 +69,7 @@ public class MainActivity extends BridgeActivity { // Register DailyNotification plugin // Plugin is written in Kotlin but compiles to Java-compatible bytecode - registerPlugin(com.timesafari.dailynotification.DailyNotificationPlugin.class); + registerPlugin(org.timesafari.dailynotification.DailyNotificationPlugin.class); // Initialize SQLite //registerPlugin(SQLite.class); diff --git a/android/app/src/main/java/app/timesafari/TimeSafariApplication.java b/android/app/src/main/java/app/timesafari/TimeSafariApplication.java index c06846c8..845d085c 100644 --- a/android/app/src/main/java/app/timesafari/TimeSafariApplication.java +++ b/android/app/src/main/java/app/timesafari/TimeSafariApplication.java @@ -3,8 +3,8 @@ package app.timesafari; import android.app.Application; import android.content.Context; import android.util.Log; -import com.timesafari.dailynotification.DailyNotificationPlugin; -import com.timesafari.dailynotification.NativeNotificationContentFetcher; +import org.timesafari.dailynotification.DailyNotificationPlugin; +import org.timesafari.dailynotification.NativeNotificationContentFetcher; public class TimeSafariApplication extends Application { diff --git a/android/app/src/main/java/app/timesafari/TimeSafariNativeFetcher.java b/android/app/src/main/java/app/timesafari/TimeSafariNativeFetcher.java index 6ebc688e..2c2614d9 100644 --- a/android/app/src/main/java/app/timesafari/TimeSafariNativeFetcher.java +++ b/android/app/src/main/java/app/timesafari/TimeSafariNativeFetcher.java @@ -5,9 +5,9 @@ import android.util.Log; import androidx.annotation.NonNull; -import com.timesafari.dailynotification.FetchContext; -import com.timesafari.dailynotification.NativeNotificationContentFetcher; -import com.timesafari.dailynotification.NotificationContent; +import org.timesafari.dailynotification.FetchContext; +import org.timesafari.dailynotification.NativeNotificationContentFetcher; +import org.timesafari.dailynotification.NotificationContent; import java.util.ArrayList; import java.util.Collections; diff --git a/doc/daily-notification-alignment-outline.md b/doc/daily-notification-alignment-outline.md index 8f5eb446..2e45e47c 100644 --- a/doc/daily-notification-alignment-outline.md +++ b/doc/daily-notification-alignment-outline.md @@ -60,7 +60,7 @@ ### 2.2 (Optional) Add NotifyReceiver -- [ ] If the plugin’s Android integration expects **NotifyReceiver** for alarm-based delivery, add a `` for `com.timesafari.dailynotification.NotifyReceiver` inside `` (see test app manifest for exact declaration). +- [ ] If the plugin’s Android integration expects **NotifyReceiver** for alarm-based delivery, add a `` for `org.timesafari.dailynotification.NotifyReceiver` inside `` (see test app manifest for exact declaration). ### 2.3 (Optional) BootReceiver options diff --git a/doc/daily-notification-plugin-android-receiver-issue.md b/doc/daily-notification-plugin-android-receiver-issue.md index 79e286bc..4dc95d23 100644 --- a/doc/daily-notification-plugin-android-receiver-issue.md +++ b/doc/daily-notification-plugin-android-receiver-issue.md @@ -56,31 +56,31 @@ Alarms are being scheduled successfully and fire at the correct time, but the `D ```xml - + ``` - ✅ `exported="true"` is set (required for AlarmManager broadcasts) -- ✅ Intent action matches: `com.timesafari.daily.NOTIFICATION` +- ✅ Intent action matches: `org.timesafari.daily.NOTIFICATION` - ✅ Receiver is inside `` tag ### Alarm Scheduling Evidence From logs when scheduling (23:51:32): ``` -I DNP-SCHEDULE: Scheduling OS alarm: variant=ALARM_CLOCK, action=com.timesafari.daily.NOTIFICATION, triggerTime=1770105300000, requestCode=44490, scheduleId=timesafari_daily_reminder +I DNP-SCHEDULE: Scheduling OS alarm: variant=ALARM_CLOCK, action=org.timesafari.daily.NOTIFICATION, triggerTime=1770105300000, requestCode=44490, scheduleId=timesafari_daily_reminder I DNP-NOTIFY: Alarm clock scheduled (setAlarmClock): triggerAt=1770105300000, requestCode=44490 ``` From `dumpsys alarm` output: ``` RTC_WAKEUP #36: Alarm{7a8fb5e type 0 origWhen 1770148800000 whenElapsed 122488536 app.timesafari.app} - tag=*walarm*:com.timesafari.daily.NOTIFICATION + tag=*walarm*:org.timesafari.daily.NOTIFICATION type=RTC_WAKEUP origWhen=2026-02-03 12:00:00.000 window=0 exactAllowReason=policy_permission operation=PendingIntent{6fce955: PendingIntentRecord{5856f6a app.timesafari.app broadcastIntent}} ``` @@ -94,12 +94,12 @@ RTC_WAKEUP #36: Alarm{7a8fb5e type 0 origWhen 1770148800000 whenElapsed 12248853 ### Manual Broadcast Test (Works) ```bash -adb shell am broadcast -a com.timesafari.daily.NOTIFICATION -n app.timesafari.app/com.timesafari.dailynotification.DailyNotificationReceiver +adb shell am broadcast -a org.timesafari.daily.NOTIFICATION -n app.timesafari.app/org.timesafari.dailynotification.DailyNotificationReceiver ``` **Result**: ✅ Receiver triggered successfully ``` -02-02 23:46:07.505 DailyNotificationReceiver D DN|RECEIVE_START action=com.timesafari.daily.NOTIFICATION +02-02 23:46:07.505 DailyNotificationReceiver D DN|RECEIVE_START action=org.timesafari.daily.NOTIFICATION 02-02 23:46:07.506 DailyNotificationReceiver W DN|RECEIVE_ERR missing_id ``` @@ -116,7 +116,7 @@ The PendingIntent may be created without explicitly specifying the component, ca **Expected Fix**: When creating the PendingIntent for AlarmManager, explicitly set the component: ```kotlin -val intent = Intent("com.timesafari.daily.NOTIFICATION").apply { +val intent = Intent("org.timesafari.daily.NOTIFICATION").apply { setComponent(ComponentName(context, DailyNotificationReceiver::class.java)) putExtra("id", scheduleId) // Also fix missing_id issue } @@ -222,7 +222,7 @@ intent.putExtra("scheduleId", scheduleId) // if receiver expects different key When an alarm fires: 1. AlarmManager delivers the broadcast 2. `DailyNotificationReceiver.onReceive()` is called -3. Log shows: `DN|RECEIVE_START action=com.timesafari.daily.NOTIFICATION` +3. Log shows: `DN|RECEIVE_START action=org.timesafari.daily.NOTIFICATION` 4. Receiver finds the ID in Intent extras (no `missing_id` error) 5. Notification is displayed @@ -243,8 +243,8 @@ When an alarm fires: ```bash # This works - receiver is triggered adb shell am broadcast \ - -a com.timesafari.daily.NOTIFICATION \ - -n app.timesafari.app/com.timesafari.dailynotification.DailyNotificationReceiver \ + -a org.timesafari.daily.NOTIFICATION \ + -n app.timesafari.app/org.timesafari.dailynotification.DailyNotificationReceiver \ --es "id" "timesafari_daily_reminder" ``` diff --git a/doc/plugin-fix-scheduleExactNotification-calls.md b/doc/plugin-fix-scheduleExactNotification-calls.md index dba699ce..571710b1 100644 --- a/doc/plugin-fix-scheduleExactNotification-calls.md +++ b/doc/plugin-fix-scheduleExactNotification-calls.md @@ -12,8 +12,8 @@ error: method scheduleExactNotification in class NotifyReceiver cannot be applie ``` **Affected files (in the plugin repo):** -- `android/src/main/java/com/timesafari/dailynotification/DailyNotificationReceiver.java` -- `android/src/main/java/com/timesafari/dailynotification/DailyNotificationWorker.java` +- `android/src/main/java/org/timesafari/dailynotification/DailyNotificationReceiver.java` +- `android/src/main/java/org/timesafari/dailynotification/DailyNotificationWorker.java` ## Current Kotlin signature (NotifyReceiver.kt) @@ -40,27 +40,27 @@ In both Java files, add the **8th argument** to every call to `NotifyReceiver.sc **Current call:** ```java -com.timesafari.dailynotification.NotifyReceiver.scheduleExactNotification( +org.timesafari.dailynotification.NotifyReceiver.scheduleExactNotification( context, nextScheduledTime, config, false, // isStaticReminder null, // reminderId scheduleId, - com.timesafari.dailynotification.ScheduleSource.ROLLOVER_ON_FIRE + org.timesafari.dailynotification.ScheduleSource.ROLLOVER_ON_FIRE ); ``` **Fixed call (add 8th argument):** ```java -com.timesafari.dailynotification.NotifyReceiver.scheduleExactNotification( +org.timesafari.dailynotification.NotifyReceiver.scheduleExactNotification( context, nextScheduledTime, config, false, // isStaticReminder null, // reminderId scheduleId, - com.timesafari.dailynotification.ScheduleSource.ROLLOVER_ON_FIRE, + org.timesafari.dailynotification.ScheduleSource.ROLLOVER_ON_FIRE, false // skipPendingIntentIdempotence – rollover path does not skip ); ``` @@ -71,27 +71,27 @@ com.timesafari.dailynotification.NotifyReceiver.scheduleExactNotification( **Current call:** ```java -com.timesafari.dailynotification.NotifyReceiver.scheduleExactNotification( +org.timesafari.dailynotification.NotifyReceiver.scheduleExactNotification( getApplicationContext(), nextScheduledTime, config, false, // isStaticReminder null, // reminderId scheduleId, - com.timesafari.dailynotification.ScheduleSource.ROLLOVER_ON_FIRE + org.timesafari.dailynotification.ScheduleSource.ROLLOVER_ON_FIRE ); ``` **Fixed call (add 8th argument):** ```java -com.timesafari.dailynotification.NotifyReceiver.scheduleExactNotification( +org.timesafari.dailynotification.NotifyReceiver.scheduleExactNotification( getApplicationContext(), nextScheduledTime, config, false, // isStaticReminder null, // reminderId scheduleId, - com.timesafari.dailynotification.ScheduleSource.ROLLOVER_ON_FIRE, + org.timesafari.dailynotification.ScheduleSource.ROLLOVER_ON_FIRE, false // skipPendingIntentIdempotence – rollover path does not skip ); ``` diff --git a/docs/plugin-feedback-android-post-reboot-fallback-text.md b/docs/plugin-feedback-android-post-reboot-fallback-text.md index d618d472..980880e5 100644 --- a/docs/plugin-feedback-android-post-reboot-fallback-text.md +++ b/docs/plugin-feedback-android-post-reboot-fallback-text.md @@ -29,7 +29,7 @@ So boot recovery does **not** replace the alarm; the existing PendingIntent is k **When the notification fires (after reboot):** ``` -02-23 16:32:00.601 D/DailyNotificationReceiver: DN|RECEIVE_START action=com.timesafari.daily.NOTIFICATION +02-23 16:32:00.601 D/DailyNotificationReceiver: DN|RECEIVE_START action=org.timesafari.daily.NOTIFICATION 02-23 16:32:00.650 D/DailyNotificationReceiver: DN|WORK_ENQUEUE display=notify_1771835520000 work_name=display_notify_1771835520000 02-23 16:32:00.847 D/DailyNotificationWorker: DN|WORK_START id=notify_1771835520000 action=display ... 02-23 16:32:00.912 D/DailyNotificationWorker: DN|DISPLAY_START id=notify_1771835520000 diff --git a/docs/plugin-feedback-android-rollover-after-reboot.md b/docs/plugin-feedback-android-rollover-after-reboot.md index b5141bd0..0db89cc0 100644 --- a/docs/plugin-feedback-android-rollover-after-reboot.md +++ b/docs/plugin-feedback-android-rollover-after-reboot.md @@ -45,7 +45,7 @@ Logcat from a real test (schedule set, device restarted shortly after, app not l **At scheduled time (19:00:00):** ``` -02-24 19:00:00 ... DailyNotificationReceiver: DN|RECEIVE_START action=com.timesafari.daily.NOTIFICATION +02-24 19:00:00 ... DailyNotificationReceiver: DN|RECEIVE_START action=org.timesafari.daily.NOTIFICATION 02-24 19:00:00 ... DailyNotificationWorker: DN|DISPLAY_NOTIF_OK ... 02-24 19:00:01 ... DN|ROLLOVER next=1772017200000 scheduleId=daily_rollover_1771930801007 ... ``` diff --git a/ios/App/App/Info.plist b/ios/App/App/Info.plist index 0eecbda2..c5e2d6b1 100644 --- a/ios/App/App/Info.plist +++ b/ios/App/App/Info.plist @@ -65,10 +65,10 @@ BGTaskSchedulerPermittedIdentifiers - com.timesafari.dailynotification.fetch - com.timesafari.dailynotification.notify - com.timesafari.dailynotification.content-fetch - com.timesafari.dailynotification.notification-delivery + org.timesafari.dailynotification.fetch + org.timesafari.dailynotification.notify + org.timesafari.dailynotification.content-fetch + org.timesafari.dailynotification.notification-delivery NSUserNotificationAlertStyle alert diff --git a/ios/App/Podfile.lock b/ios/App/Podfile.lock index df725baa..1cd7746a 100644 --- a/ios/App/Podfile.lock +++ b/ios/App/Podfile.lock @@ -86,7 +86,7 @@ PODS: - SQLCipher/common (4.9.0) - SQLCipher/standard (4.9.0): - SQLCipher/common - - TimesafariDailyNotificationPlugin (1.3.1): + - TimesafariDailyNotificationPlugin (2.0.0): - Capacitor - ZIPFoundation (0.9.19) @@ -172,7 +172,7 @@ SPEC CHECKSUMS: nanopb: 438bc412db1928dac798aa6fd75726007be04262 PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 SQLCipher: 31878d8ebd27e5c96db0b7cb695c96e9f8ad77da - TimesafariDailyNotificationPlugin: 1027e97c6d47178ed20a8d3f01cf462f42ba8f1e + TimesafariDailyNotificationPlugin: 3c12e8c39fc27f689f56cf4e57230a8c28611fcc ZIPFoundation: b8c29ea7ae353b309bc810586181fd073cb3312c PODFILE CHECKSUM: 6d92bfa46c6c2d31d19b8c0c38f56a8ae9fd222f diff --git a/package-lock.json b/package-lock.json index 1aca2735..970f9e28 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4637,9 +4637,9 @@ } }, "node_modules/@expo/cli": { - "version": "55.0.15", - "resolved": "https://registry.npmjs.org/@expo/cli/-/cli-55.0.15.tgz", - "integrity": "sha512-Qd4aF2+wT9LtdV7G/gULbx/t8FJ/OVtwuNkLcZt1XlosQ5XX/C/3ywZXYl+/bYcHUmuO1TBD3Fg05bNlmL6vrw==", + "version": "55.0.16", + "resolved": "https://registry.npmjs.org/@expo/cli/-/cli-55.0.16.tgz", + "integrity": "sha512-rp1mBnA5msGDPTfFuqVl+9RsJOtuA0cXsWSJpHdvsIxcSVg0oJyF/rgvrwsFrNQCLXzkMXm+o3CsY9iL1D/CDA==", "license": "MIT", "optional": true, "dependencies": { @@ -4658,7 +4658,7 @@ "@expo/plist": "^0.5.2", "@expo/prebuild-config": "^55.0.8", "@expo/require-utils": "^55.0.2", - "@expo/router-server": "^55.0.9", + "@expo/router-server": "^55.0.10", "@expo/schema-utils": "^55.0.2", "@expo/spawn-async": "^1.7.2", "@expo/ws-tunnel": "^1.0.1", @@ -5467,9 +5467,9 @@ } }, "node_modules/@expo/fingerprint": { - "version": "0.16.5", - "resolved": "https://registry.npmjs.org/@expo/fingerprint/-/fingerprint-0.16.5.tgz", - "integrity": "sha512-mLrcymtgkW9IJ/G1e8MH1Xt2VIb1MOS86ePY0ePcnV3nVyJqm7gfa/AXD1Hk+eZXvf8XhioYz6QZaamBdEzR3A==", + "version": "0.16.6", + "resolved": "https://registry.npmjs.org/@expo/fingerprint/-/fingerprint-0.16.6.tgz", + "integrity": "sha512-nRITNbnu3RKSHPvKVehrSU4KG2VY9V8nvULOHBw98ukHCAU4bGrU5APvcblOkX3JAap+xEHsg/mZvqlvkLInmQ==", "license": "MIT", "optional": true, "dependencies": { @@ -6175,9 +6175,9 @@ } }, "node_modules/@expo/router-server": { - "version": "55.0.9", - "resolved": "https://registry.npmjs.org/@expo/router-server/-/router-server-55.0.9.tgz", - "integrity": "sha512-LcCFi+P1qfZOsw0DO4JwNKRxtWt4u2bjTYj0PUe4WVf9NVG/NfUetAXYRbBS6P+gupfM6SC+/bdzdqCWQh7j8g==", + "version": "55.0.10", + "resolved": "https://registry.npmjs.org/@expo/router-server/-/router-server-55.0.10.tgz", + "integrity": "sha512-NZQzHwkaedufNPayVfPxsZGEMngOD3gDvYx9lld4sitRexrKDx5sHmmNHi6IByGbmCb4jwLXub5sIyWh6z1xPQ==", "license": "MIT", "optional": true, "dependencies": { @@ -8685,8 +8685,8 @@ } }, "node_modules/@timesafari/daily-notification-plugin": { - "version": "1.3.3", - "resolved": "git+https://gitea.anomalistdesign.com/trent_larson/daily-notification-plugin.git#b8d9b6247d670929418b12e7135d8dd3c9684277", + "version": "2.0.0", + "resolved": "git+https://gitea.anomalistdesign.com/trent_larson/daily-notification-plugin.git#ca6a75ded82eda036508947fa78e41a45656fac3", "license": "MIT", "workspaces": [ "packages/*" @@ -11323,9 +11323,9 @@ } }, "node_modules/babel-preset-expo": { - "version": "55.0.10", - "resolved": "https://registry.npmjs.org/babel-preset-expo/-/babel-preset-expo-55.0.10.tgz", - "integrity": "sha512-aRtW7qJKohGU2V0LUJ6IeP7py3+kVUo9zcc8+v1Kix8jGGuIvqvpo9S6W1Fmn9VFP2DBwkFDLiyzkCZS85urVA==", + "version": "55.0.11", + "resolved": "https://registry.npmjs.org/babel-preset-expo/-/babel-preset-expo-55.0.11.tgz", + "integrity": "sha512-ti8t4xufD6gUQQh+qY+b+VT/1zyA0n1PBnwOzCkPUyEDiIVBpaOixR+BzVH68hqu9mH2wDfzoFuGgv+2LfRdqw==", "license": "MIT", "optional": true, "dependencies": { @@ -11356,7 +11356,7 @@ "peerDependencies": { "@babel/runtime": "^7.20.0", "expo": "*", - "expo-widgets": "^55.0.2", + "expo-widgets": "^55.0.4", "react-refresh": ">=0.14.0 <1.0.0" }, "peerDependenciesMeta": { diff --git a/scripts/test-notification-receiver.sh b/scripts/test-notification-receiver.sh index 596d4439..a5ae0215 100755 --- a/scripts/test-notification-receiver.sh +++ b/scripts/test-notification-receiver.sh @@ -69,7 +69,7 @@ echo "" # Get the package name PACKAGE_NAME="app.timesafari.app" -INTENT_ACTION="com.timesafari.daily.NOTIFICATION" +INTENT_ACTION="org.timesafari.daily.NOTIFICATION" echo "Package: $PACKAGE_NAME" echo "Intent Action: $INTENT_ACTION" @@ -89,11 +89,11 @@ fi # Test 1: Send broadcast intent to trigger receiver (without ID - simulates current bug) echo "Test 1: Sending broadcast intent to DailyNotificationReceiver (without ID)..." -"$ADB_CMD" shell am broadcast -a "$INTENT_ACTION" -n "$PACKAGE_NAME/com.timesafari.dailynotification.DailyNotificationReceiver" +"$ADB_CMD" shell am broadcast -a "$INTENT_ACTION" -n "$PACKAGE_NAME/org.timesafari.dailynotification.DailyNotificationReceiver" echo "" echo "Test 2: Sending broadcast intent WITH ID (to test if receiver works with ID)..." -"$ADB_CMD" shell am broadcast -a "$INTENT_ACTION" -n "$PACKAGE_NAME/com.timesafari.dailynotification.DailyNotificationReceiver" --es "id" "timesafari_daily_reminder" +"$ADB_CMD" shell am broadcast -a "$INTENT_ACTION" -n "$PACKAGE_NAME/org.timesafari.dailynotification.DailyNotificationReceiver" --es "id" "timesafari_daily_reminder" echo "" echo "Check logcat for 'DN|RECEIVE_START' to see if receiver was triggered"