docs: add comprehensive static daily reminders documentation

- Add static daily reminders to README.md core features and API reference
- Create detailed usage guide in USAGE.md with examples and best practices
- Add version 2.1.0 changelog entry documenting new reminder functionality
- Create examples/static-daily-reminders.ts with complete usage examples
- Update test-apps README to include reminder testing capabilities

The static daily reminder feature provides simple daily notifications
without network content dependency, supporting cross-platform scheduling
with rich customization options.
This commit is contained in:
Matthew Raymer
2025-10-05 05:12:06 +00:00
parent 9ec30974da
commit f9c21d4e5b
21 changed files with 2120 additions and 0 deletions

View File

@@ -39,6 +39,7 @@ The Daily Notification Plugin is a comprehensive Capacitor plugin that provides
- **TTL-at-Fire Logic**: Content validity checking at notification time
- **Callback System**: HTTP, local, and queue callback support
- **Circuit Breaker Pattern**: Automatic failure detection and recovery
- **Static Daily Reminders**: Simple daily notifications without network content
- **Cross-Platform**: Android, iOS, and Web implementations
### 📱 **Platform Support**
@@ -54,6 +55,15 @@ The Daily Notification Plugin is a comprehensive Capacitor plugin that provides
- **Error Handling**: Exponential backoff and retry logic
- **Security**: Encrypted storage and secure callback handling
### ⏰ **Static Daily Reminders**
- **No Network Required**: Completely offline reminder notifications
- **Simple Scheduling**: Easy daily reminder setup with HH:mm time format
- **Rich Customization**: Customizable title, body, sound, vibration, and priority
- **Persistent Storage**: Survives app restarts and device reboots
- **Cross-Platform**: Consistent API across Android, iOS, and Web
- **Management**: Full CRUD operations for reminder management
## Installation
```bash
@@ -130,6 +140,45 @@ function saveToDatabase(event: CallbackEvent) {
}
```
### Static Daily Reminders
For simple daily reminders that don't require network content:
```typescript
import { DailyNotification } from '@timesafari/daily-notification-plugin';
// Schedule a simple daily reminder
await DailyNotification.scheduleDailyReminder({
id: 'morning_checkin',
title: 'Good Morning!',
body: 'Time to check your TimeSafari community updates',
time: '09:00', // HH:mm format
sound: true,
vibration: true,
priority: 'normal',
repeatDaily: true
});
// Get all scheduled reminders
const result = await DailyNotification.getScheduledReminders();
console.log('Scheduled reminders:', result.reminders);
// Update an existing reminder
await DailyNotification.updateDailyReminder('morning_checkin', {
title: 'Updated Morning Reminder',
time: '08:30'
});
// Cancel a reminder
await DailyNotification.cancelDailyReminder('morning_checkin');
```
**Key Benefits of Static Reminders:**
-**No network dependency** - works completely offline
-**No content cache required** - direct notification display
-**Simple API** - easy to use for basic reminder functionality
-**Persistent** - survives app restarts and device reboots
## API Reference
### Core Methods
@@ -257,6 +306,55 @@ const status = await DailyNotification.getDualScheduleStatus();
- **HTTPS**: Required for Service Worker and push notifications
- **Browser Support**: Chrome 40+, Firefox 44+, Safari 11.1+
### Static Daily Reminder Methods
#### `scheduleDailyReminder(options)`
Schedule a simple daily reminder without network content.
```typescript
await DailyNotification.scheduleDailyReminder({
id: string; // Unique reminder identifier
title: string; // Notification title
body: string; // Notification body
time: string; // Time in HH:mm format (e.g., "09:00")
sound?: boolean; // Enable sound (default: true)
vibration?: boolean; // Enable vibration (default: true)
priority?: 'low' | 'normal' | 'high'; // Priority level (default: 'normal')
repeatDaily?: boolean; // Repeat daily (default: true)
timezone?: string; // Optional timezone
});
```
#### `cancelDailyReminder(reminderId)`
Cancel a scheduled daily reminder.
```typescript
await DailyNotification.cancelDailyReminder('morning_checkin');
```
#### `getScheduledReminders()`
Get all scheduled reminders.
```typescript
const result = await DailyNotification.getScheduledReminders();
console.log('Reminders:', result.reminders);
```
#### `updateDailyReminder(reminderId, options)`
Update an existing daily reminder.
```typescript
await DailyNotification.updateDailyReminder('morning_checkin', {
title: 'Updated Title',
time: '08:30',
priority: 'high'
});
```
## Configuration
### Android Configuration