Matthew Raymer 0bb5a8d218 feat(android)!: implement Phase 2 Android core with WorkManager + AlarmManager + SQLite
- Add complete SQLite schema with Room database (content_cache, schedules, callbacks, history)
- Implement WorkManager FetchWorker with exponential backoff and network constraints
- Add AlarmManager NotifyReceiver with TTL-at-fire logic and notification delivery
- Create BootReceiver for automatic rescheduling after device reboot
- Update AndroidManifest.xml with necessary permissions and receivers
- Add Room, WorkManager, and Kotlin coroutines dependencies to build.gradle

feat(callback-registry)!: implement callback registry with circuit breaker

- Add CallbackRegistryImpl with HTTP, local, and queue callback support
- Implement circuit breaker pattern with exponential backoff retry logic
- Add CallbackEvent interface with structured event types
- Support for exactly-once delivery semantics with retry queue
- Include callback status monitoring and health checks

feat(observability)!: add comprehensive observability and health monitoring

- Implement ObservabilityManager with structured logging and event codes
- Add performance metrics tracking (fetch, notify, callback times)
- Create health status API with circuit breaker monitoring
- Include log compaction and metrics reset functionality
- Support for DNP-* event codes throughout the system

feat(web)!: enhance web implementation with new functionality

- Integrate callback registry and observability into web platform
- Add mock implementations for dual scheduling methods
- Implement performance tracking and structured logging
- Support for local callback registration and management
- Enhanced error handling and event logging

BREAKING CHANGE: New Android dependencies require Room, WorkManager, and Kotlin coroutines
2025-09-22 09:02:04 +00:00
2025-09-22 07:27:01 +00:00
2025-09-22 07:27:01 +00:00
2025-09-22 07:27:01 +00:00
2025-09-22 07:27:01 +00:00
2025-09-22 07:27:01 +00:00

Daily Notification Plugin

A Native-First Capacitor plugin for reliable daily notifications across Android, iOS, and Web platforms.

Key Features

  • 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

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

npm install @timesafari/daily-notification-plugin

Documentation

Examples

  • 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

Android

Add the following permissions to your AndroidManifest.xml:

<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
<uses-permission android:name="android.permission.USE_EXACT_ALARM" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Development

Prerequisites

  • Node.js 14 or later
  • Android Studio
  • Android SDK
  • Gradle

Building

# Install dependencies
npm install

# Build the plugin
npm run build

# Run tests
npm test

Project Structure

daily-notification-plugin/
├── android/                 # Android implementation
│   ├── app/                # Main application module
│   └── build.gradle        # Root build configuration
├── src/                    # TypeScript source
├── tests/                  # Test files
├── package.json           # Package configuration
└── README.md              # This file

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Matthew Raymer

Security

This plugin follows security best practices:

  • Uses AndroidX for modern security features
  • Implements proper permission handling
  • Follows Android security guidelines
  • Uses secure storage for sensitive data
  • Implements proper error handling
  • Logs security-relevant events
  • Uses secure communication channels
  • Implements proper access control
  • Follows Android's security model
  • Uses secure defaults

Changelog

1.0.0

  • Initial release
  • Basic notification scheduling
  • System state handling
  • Battery optimization support
  • Background task management
  • Rich logging system
Description
No description provided
Readme MIT 10 MiB
Languages
Java 43.5%
TypeScript 17.1%
Swift 13.1%
Kotlin 8.8%
Shell 6.5%
Other 11%