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.
 
 
 
 
 
 
Matthew Raymer a54ba34cb9 feat(ios): Enhance battery optimization and notification management 1 month ago
.github refactor: improve build configuration and code organization 2 months ago
android feat(android): Enhance battery optimization and notification management 1 month ago
examples refactor: improve build configuration and code organization 2 months ago
gradle feat(android): Enhance battery optimization and notification management 1 month ago
ios feat(ios): Enhance battery optimization and notification management 1 month ago
lib feat(ios): Enhance battery optimization and notification management 1 month ago
scripts refactor: improve build configuration and code organization 2 months ago
src refactor: improve build configuration and code organization 2 months ago
tests refactor: improve build configuration and code organization 2 months ago
www refactor: improve build configuration and code organization 2 months ago
.gitattributes feat(android): Enhance battery optimization and notification management 1 month ago
.gitignore feat(android): Enhance battery optimization and notification management 1 month ago
CHANGELOG.md refactor: improve build configuration and code organization 2 months ago
CONTRIBUTING.md refactor: improve build configuration and code organization 2 months ago
CapacitorDailyNotification.podspec refactor: improve build configuration and code organization 2 months ago
LICENSE refactor: improve build configuration and code organization 2 months ago
README.md feat: implement core notification functionality for iOS and Android - Add settings management, proper error handling, and platform-specific implementations 1 month ago
SECURITY.md refactor: improve build configuration and code organization 2 months ago
build.gradle.kts feat(android): Enhance battery optimization and notification management 1 month ago
capacitor.config.ts refactor: improve build configuration and code organization 2 months ago
gradle.properties feat(android): Enhance battery optimization and notification management 1 month ago
gradlew feat(android): Enhance battery optimization and notification management 1 month ago
gradlew.bat feat(android): Enhance battery optimization and notification management 1 month ago
jest.config.js refactor: improve build configuration and code organization 2 months ago
package-lock.json feat: implement core notification functionality for iOS and Android - Add settings management, proper error handling, and platform-specific implementations 1 month ago
package.json feat: implement core notification functionality for iOS and Android - Add settings management, proper error handling, and platform-specific implementations 1 month ago
settings.gradle.kts feat(android): Enhance battery optimization and notification management 1 month ago
tsconfig.json refactor: improve build configuration and code organization 2 months ago

README.md

Daily Notification Plugin for Capacitor

A Capacitor plugin for scheduling and managing daily notifications with advanced features and robust error handling.

Features

  • Schedule daily notifications with custom time and content
  • Support for different priority levels
  • Timezone-aware scheduling
  • Offline support with caching
  • Comprehensive permission handling
  • Automatic retry logic
  • Detailed notification status tracking
  • Configurable settings management

Installation

npm install daily-notification-plugin
npx cap sync

iOS Setup

No additional setup required for iOS. The plugin automatically handles all necessary configurations.

Usage

Basic Usage

import { DailyNotification } from 'daily-notification-plugin';

// Schedule a daily notification
await DailyNotification.scheduleDailyNotification({
  url: 'https://api.example.com/updates',
  time: '09:00',
  title: 'Daily Update',
  body: 'Your daily update is ready'
});

Advanced Features

Custom Priority

await DailyNotification.scheduleDailyNotification({
  url: 'https://api.example.com/updates',
  time: '09:00',
  priority: 'high'
});

Timezone Support

await DailyNotification.scheduleDailyNotification({
  url: 'https://api.example.com/updates',
  time: '09:00',
  timezone: 'America/New_York'
});

Check Notification Status

const status = await DailyNotification.getNotificationStatus();
console.log('Notification status:', status);

Update Settings

await DailyNotification.updateSettings({
  sound: true,
  priority: 'high',
  timezone: 'America/Los_Angeles'
});

API Documentation

Methods

scheduleDailyNotification(options: ScheduleOptions)

Schedule a new daily notification.

getLastNotification()

Get information about the last delivered notification.

cancelAllNotifications()

Cancel all pending notifications.

getNotificationStatus()

Get current notification status and settings.

updateSettings(settings: NotificationSettings)

Update notification settings.

checkPermissions()

Check current notification permissions.

requestPermissions()

Request notification permissions.

Types

interface ScheduleOptions {
  url: string;
  time: string;
  title?: string;
  body?: string;
  sound?: boolean;
  priority?: 'high' | 'default' | 'low';
  timezone?: string;
}

interface NotificationSettings {
  sound?: boolean;
  priority?: string;
  timezone?: string;
}

Error Handling

The plugin provides detailed error messages for various scenarios:

  • Invalid parameters
  • Permission issues
  • Scheduling failures
  • Invalid time formats
  • Invalid timezone identifiers
  • Invalid priority values

Contributing

Contributions are welcome! Please read our contributing guidelines and submit pull requests to our GitHub repository.

License

MIT License - see LICENSE file for details