- Android: move plugin source to org/timesafari/dailynotification, update namespace, manifest package, and all package/imports; change intent actions to org.timesafari.daily.NOTIFICATION and DISMISS - iOS: update bundle IDs, BGTask identifiers, subsystem labels, and queue names in Plugin and Xcode projects - Capacitor: update plugin class registration and appIds in configs - Test apps (android-test-app, daily-notification-test, ios-test-app): applicationId/bundleId, manifests, ProGuard, scripts, and docs - Docs: bulk update references; add CONSUMING_APP_MIGRATION_COM_TO_ORG.md for consuming app migration BREAKING CHANGE: Consuming apps must update plugin class to org.timesafari.dailynotification.DailyNotificationPlugin, manifest receivers/actions, and iOS BGTask identifiers per migration doc.
3.7 KiB
3.7 KiB
Getting Started
Purpose: Step-by-step installation and setup guide for Daily Notification Plugin.
Owner: Development Team
Last Updated: 2025-12-22
Status: active
Installation
npm
npm install @timesafari/daily-notification-plugin
yarn
yarn add @timesafari/daily-notification-plugin
pnpm
pnpm add @timesafari/daily-notification-plugin
Platform Setup
iOS
- Add to
Info.plist:
<key>BGTaskSchedulerPermittedIdentifiers</key>
<array>
<string>org.timesafari.dailynotification.fetch</string>
</array>
- Register background task in
AppDelegate.swift:
import BackgroundTasks
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
BGTaskScheduler.shared.register(forTaskWithIdentifier: "org.timesafari.dailynotification.fetch",
using: nil) { task in
// Handle background fetch task
}
return true
}
Android
- Add permissions to
AndroidManifest.xml:
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
Note on
USE_EXACT_ALARM: TheUSE_EXACT_ALARMpermission is restricted by Google on Android. Apps that declare it must be primarily dedicated to alarm or calendar functionality. Google will reject apps from the Play Store that use this permission for other purposes. This plugin usesSCHEDULE_EXACT_ALARMinstead, which is sufficient for scheduling daily notifications.
- Register WorkManager in
Application.kt:
import androidx.work.Configuration
import androidx.work.WorkManager
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
WorkManager.initialize(
this,
Configuration.Builder()
.setMinimumLoggingLevel(android.util.Log.INFO)
.build()
)
}
}
Basic Usage
1. Import the Plugin
import { DailyNotification } from '@timesafari/daily-notification-plugin';
2. Request Permission
const { state } = await DailyNotification.requestPermission();
if (state !== 'granted') {
console.error('Notification permission denied');
return;
}
3. Create a Schedule
const { schedule } = await DailyNotification.createSchedule({
id: 'morning-notification',
kind: 'notify',
clockTime: '09:00',
enabled: true
});
4. Verify Schedule
const { schedules } = await DailyNotification.getSchedules();
console.log('Active schedules:', schedules);
Next Steps
- Quick Start Guide — Minimal working example
- Common Patterns — Common integration patterns
- Integration Guide — Full integration guide
- Troubleshooting — Common issues and solutions
Authoritative Documentation
- Documentation Index — Complete documentation navigation
- System Invariants — Enforced system invariants
- CI Usage — Local CI documentation (
./ci/run.sh)
Support
For issues, questions, or contributions:
- Check Troubleshooting Guide
- Review System Invariants
- Check Progress Documentation for current status
See also:
- README.md — Complete plugin documentation
- Performance Characteristics — Performance expectations