chore: align with daily-notification-plugin 2.0.0 (org.timesafari namespace)

- 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
This commit is contained in:
Jose Olarte III
2026-03-12 17:20:45 +08:00
parent fb9d5165df
commit 9902e5fac7
14 changed files with 60 additions and 60 deletions

View File

@@ -60,7 +60,7 @@
### 2.2 (Optional) Add NotifyReceiver
- [ ] If the plugins Android integration expects **NotifyReceiver** for alarm-based delivery, add a `<receiver>` for `com.timesafari.dailynotification.NotifyReceiver` inside `<application>` (see test app manifest for exact declaration).
- [ ] If the plugins Android integration expects **NotifyReceiver** for alarm-based delivery, add a `<receiver>` for `org.timesafari.dailynotification.NotifyReceiver` inside `<application>` (see test app manifest for exact declaration).
### 2.3 (Optional) BootReceiver options

View File

@@ -56,31 +56,31 @@ Alarms are being scheduled successfully and fire at the correct time, but the `D
```xml
<receiver
android:name="com.timesafari.dailynotification.DailyNotificationReceiver"
android:name="org.timesafari.dailynotification.DailyNotificationReceiver"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="com.timesafari.daily.NOTIFICATION" />
<action android:name="org.timesafari.daily.NOTIFICATION" />
</intent-filter>
</receiver>
```
-`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 `<application>` 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"
```

View File

@@ -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
);
```