feat: add minimal Capacitor test apps for all platforms

- Add Android test app with exact alarm permission testing
- Add iOS test app with rolling window and BGTaskScheduler testing
- Add Electron test app with mock implementations and IPC
- Include automated setup scripts for each platform
- Provide comprehensive testing checklist and troubleshooting guide
- Follow best practices for Capacitor plugin testing

Test apps include:
- Plugin configuration and scheduling validation
- Platform-specific feature testing (Android exact alarms, iOS rolling window)
- Performance monitoring and debug information
- Error handling and edge case testing
- Cross-platform API consistency validation

Setup: Run ./setup-*.sh scripts for automated platform setup
Testing: Each app provides interactive UI for comprehensive plugin validation

Files: 25+ new files across test-apps/ directory
This commit is contained in:
Matthew Raymer
2025-09-09 05:24:27 +00:00
parent 0ccf071f5c
commit 956abff320
29 changed files with 2167 additions and 39 deletions

View File

@@ -1,16 +1,35 @@
# Daily Notification Plugin
A Capacitor plugin for scheduling and managing daily notifications on Android devices.
A Native-First Capacitor plugin for reliable daily notifications across Android, iOS, and Web platforms.
## Features
## Key Features
- Schedule daily notifications with precise timing
- Handle system state changes (battery, power, etc.)
- Support for adaptive scheduling based on device state
- Background task management
- Battery optimization support
- Rich logging system
- Comprehensive error handling
- **Native-First Architecture**: Optimized for mobile platforms with offline-first design
- **Shared SQLite Storage**: Single database file with WAL mode for concurrent access
- **TTL-at-Fire Enforcement**: Skip stale notifications before delivery
- **Rolling Window Safety**: Always keep today's notifications armed
- **Cross-Platform**: Unified API across Android, iOS, and Web
- **Production Ready**: Comprehensive error handling, performance optimization, and monitoring
## Quick Start
```typescript
import { DailyNotification } from '@timesafari/daily-notification-plugin';
// Configure and schedule
await DailyNotification.configure({
storage: 'shared',
ttlSeconds: 1800,
prefetchLeadMinutes: 15
});
await DailyNotification.scheduleDailyNotification({
url: 'https://api.example.com/daily-content',
time: '09:00',
title: 'Daily Update',
body: 'Your daily notification is ready'
});
```
## Installation
@@ -18,39 +37,23 @@ A Capacitor plugin for scheduling and managing daily notifications on Android de
npm install @timesafari/daily-notification-plugin
```
## Usage
## Documentation
```typescript
import { DailyNotification } from '@timesafari/daily-notification-plugin';
- **[Complete Usage Guide](USAGE.md)** - Comprehensive guide with examples and best practices
- **[API Reference](API.md)** - Complete method and type definitions
- **[Implementation Roadmap](doc/implementation-roadmap.md)** - Technical implementation details
- **[Notification System Spec](doc/notification-system.md)** - Architecture and design principles
- **[Glossary](doc/GLOSSARY.md)** - Key terminology and concepts
// Initialize the plugin
const dailyNotification = new DailyNotification();
## Examples
// Schedule a daily notification
await dailyNotification.scheduleDailyNotification({
sound: true,
priority: 'default',
timezone: 'UTC'
});
// Get notification status
const status = await dailyNotification.getNotificationStatus();
// Update settings
await dailyNotification.updateSettings({
sound: false,
priority: 'high'
});
// Cancel all notifications
await dailyNotification.cancelAllNotifications();
// Get battery status
const batteryStatus = await dailyNotification.getBatteryStatus();
// Request battery optimization exemption
await dailyNotification.requestBatteryOptimizationExemption();
```
- **Basic Usage**: `examples/usage.ts`
- **Phase-by-Phase Implementation**:
- Phase 1: `examples/phase1-*.ts` (Core Infrastructure)
- Phase 2: `examples/phase2-*.ts` (Platform Completion)
- Phase 3: `examples/phase3-*.ts` (Network Optimization)
- **Advanced Scenarios**: `examples/advanced-usage.ts`
- **Enterprise Features**: `examples/enterprise-usage.ts`
## Configuration