fix(test-app): register NotifyReceiver in AndroidManifest

The Vue test app was missing the NotifyReceiver registration in
AndroidManifest.xml, preventing alarm broadcasts from being delivered
to the BroadcastReceiver. This caused notifications scheduled via
setAlarmClock() to fire but not display.

Added NotifyReceiver registration matching the working android-test-app
configuration. Also includes supporting improvements:
- Enhanced alarm scheduling with setAlarmClock() for Doze exemption
- Unique request codes based on trigger time to prevent PendingIntent conflicts
- Diagnostic methods (isAlarmScheduled, getNextAlarmTime, testAlarm)
- TypeScript definitions for new methods

Verified: Notification successfully fired at 09:41:00 and was displayed.
This commit is contained in:
Matthew Raymer
2025-11-06 09:56:32 +00:00
parent 1a7ac200f1
commit a19cb2ba61
5 changed files with 281 additions and 9 deletions

View File

@@ -605,6 +605,28 @@ export interface DailyNotificationPlugin {
// Existing methods
scheduleDailyNotification(options: NotificationOptions): Promise<void>;
/**
* Check if an alarm is scheduled for a given trigger time
* @param options Object containing triggerAtMillis (number)
* @returns Object with scheduled (boolean) and triggerAtMillis (number)
*/
isAlarmScheduled(options: { triggerAtMillis: number }): Promise<{ scheduled: boolean; triggerAtMillis: number }>;
/**
* Get the next scheduled alarm time from AlarmManager
* @returns Object with scheduled (boolean) and triggerAtMillis (number | null)
*/
getNextAlarmTime(): Promise<{ scheduled: boolean; triggerAtMillis?: number }>;
/**
* Test method: Schedule an alarm to fire in a few seconds
* Useful for verifying alarm delivery works correctly
* @param options Object containing secondsFromNow (number, default: 5)
* @returns Object with scheduled (boolean), secondsFromNow (number), and triggerAtMillis (number)
*/
testAlarm(options?: { secondsFromNow?: number }): Promise<{ scheduled: boolean; secondsFromNow: number; triggerAtMillis: number }>;
getLastNotification(): Promise<NotificationResponse | null>;
cancelAllNotifications(): Promise<void>;
getNotificationStatus(): Promise<NotificationStatus>;