You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
2 months ago | |
|---|---|---|
| .cursor/rules | 2 months ago | |
| .github | 7 months ago | |
| android | 7 months ago | |
| docs | 2 months ago | |
| examples | 7 months ago | |
| gradle | 7 months ago | |
| ios | 7 months ago | |
| lib | 7 months ago | |
| scripts | 7 months ago | |
| src | 3 months ago | |
| tests | 3 months ago | |
| www | 7 months ago | |
| .eslintrc.json | 7 months ago | |
| .gitattributes | 7 months ago | |
| .gitignore | 2 months ago | |
| .prettierrc | 7 months ago | |
| CHANGELOG.md | 7 months ago | |
| CONTRIBUTING.md | 7 months ago | |
| CRITICAL_IMPROVEMENTS.md | 3 months ago | |
| CapacitorDailyNotification.podspec | 7 months ago | |
| IMPROVEMENT_SUMMARY.md | 3 months ago | |
| LICENSE | 7 months ago | |
| PROJECT_ASSESSMENT.md | 3 months ago | |
| README.md | 7 months ago | |
| SECURITY.md | 7 months ago | |
| build.gradle.kts | 7 months ago | |
| capacitor.config.ts | 7 months ago | |
| gradle.properties | 7 months ago | |
| gradlew | 7 months ago | |
| gradlew.bat | 7 months ago | |
| package-lock.json | 3 months ago | |
| package.json | 3 months ago | |
| rollup.config.js | 3 months ago | |
| settings.gradle.kts | 7 months ago | |
| tsconfig.json | 7 months ago | |
README.md
Daily Notification Plugin
A Capacitor plugin for scheduling and managing daily notifications on Android devices.
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
Installation
npm install @timesafari/daily-notification-plugin
Usage
import { DailyNotification } from '@timesafari/daily-notification-plugin';
// Initialize the plugin
const dailyNotification = new DailyNotification();
// 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();
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
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - 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