docs: add comprehensive integration guides and diagnostic method documentation
Add integration guides and update API documentation with new Android diagnostic methods. Emphasize critical NotifyReceiver registration requirement that was causing notification delivery failures. Documentation Updates: - API.md: Document isAlarmScheduled(), getNextAlarmTime(), testAlarm() - README.md: Add Quick Integration section and Android diagnostic methods - notification-testing-procedures.md: Add BroadcastReceiver troubleshooting New Integration Guides: - QUICK_INTEGRATION.md: Step-by-step guide for human developers - AI_INTEGRATION_GUIDE.md: Machine-readable guide with verification steps - TODO.md: Task tracking for pending improvements Key Improvements: - Explicit NotifyReceiver registration requirement highlighted - Complete troubleshooting flow for BroadcastReceiver issues - Diagnostic method examples for debugging alarm scheduling - AI-friendly integration instructions with verification commands Fixes notification delivery issues caused by missing NotifyReceiver registration in host app AndroidManifest.xml files.
This commit is contained in:
56
API.md
56
API.md
@@ -2,7 +2,7 @@
|
||||
|
||||
**Author**: Matthew Raymer
|
||||
**Version**: 2.2.0
|
||||
**Last Updated**: 2025-10-08 06:02:45 UTC
|
||||
**Last Updated**: 2025-11-06 09:51:00 UTC
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -74,6 +74,60 @@ Open exact alarm settings in system preferences.
|
||||
|
||||
Get reboot recovery status and statistics.
|
||||
|
||||
##### `isAlarmScheduled(options: { triggerAtMillis: number }): Promise<{ scheduled: boolean; triggerAtMillis: number }>`
|
||||
|
||||
Check if an alarm is scheduled for a specific trigger time. Useful for debugging and verification.
|
||||
|
||||
**Parameters:**
|
||||
- `options.triggerAtMillis`: `number` - The trigger time in milliseconds (Unix timestamp)
|
||||
|
||||
**Returns:**
|
||||
- `scheduled`: `boolean` - Whether the alarm is currently scheduled
|
||||
- `triggerAtMillis`: `number` - The trigger time that was checked
|
||||
|
||||
**Example:**
|
||||
```typescript
|
||||
const result = await DailyNotification.isAlarmScheduled({
|
||||
triggerAtMillis: 1762421400000
|
||||
});
|
||||
console.log(`Alarm scheduled: ${result.scheduled}`);
|
||||
```
|
||||
|
||||
##### `getNextAlarmTime(): Promise<{ scheduled: boolean; triggerAtMillis?: number }>`
|
||||
|
||||
Get the next scheduled alarm time from AlarmManager. Requires Android 5.0+ (API 21+).
|
||||
|
||||
**Returns:**
|
||||
- `scheduled`: `boolean` - Whether any alarm is scheduled
|
||||
- `triggerAtMillis`: `number | undefined` - The next alarm trigger time (if scheduled)
|
||||
|
||||
**Example:**
|
||||
```typescript
|
||||
const result = await DailyNotification.getNextAlarmTime();
|
||||
if (result.scheduled) {
|
||||
const nextAlarm = new Date(result.triggerAtMillis);
|
||||
console.log(`Next alarm: ${nextAlarm.toLocaleString()}`);
|
||||
}
|
||||
```
|
||||
|
||||
##### `testAlarm(options?: { secondsFromNow?: number }): Promise<{ scheduled: boolean; secondsFromNow: number; triggerAtMillis: number }>`
|
||||
|
||||
Schedule a test alarm that fires in a few seconds. Useful for verifying alarm delivery works correctly.
|
||||
|
||||
**Parameters:**
|
||||
- `options.secondsFromNow`: `number` (optional) - Seconds from now to fire the alarm (default: 5)
|
||||
|
||||
**Returns:**
|
||||
- `scheduled`: `boolean` - Whether the alarm was scheduled successfully
|
||||
- `secondsFromNow`: `number` - The delay used
|
||||
- `triggerAtMillis`: `number` - The trigger time in milliseconds
|
||||
|
||||
**Example:**
|
||||
```typescript
|
||||
const result = await DailyNotification.testAlarm({ secondsFromNow: 10 });
|
||||
console.log(`Test alarm scheduled for ${result.secondsFromNow} seconds`);
|
||||
```
|
||||
|
||||
### Management Methods
|
||||
|
||||
#### `maintainRollingWindow(): Promise<void>`
|
||||
|
||||
Reference in New Issue
Block a user