diff --git a/docs/00-INDEX.md b/docs/00-INDEX.md index b50860a..24f7f44 100644 --- a/docs/00-INDEX.md +++ b/docs/00-INDEX.md @@ -37,6 +37,10 @@ These files define the current truth about project state, decisions, and verific --- +## Getting Started + +- **[Getting Started Guide](./GETTING_STARTED.md)** — Installation, platform setup, and basic usage + ## Examples - **[Quick Start](./examples/QUICK_START.md)** — Minimal working example diff --git a/docs/GETTING_STARTED.md b/docs/GETTING_STARTED.md new file mode 100644 index 0000000..522a681 --- /dev/null +++ b/docs/GETTING_STARTED.md @@ -0,0 +1,159 @@ +# 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 + +```bash +npm install @timesafari/daily-notification-plugin +``` + +### yarn + +```bash +yarn add @timesafari/daily-notification-plugin +``` + +### pnpm + +```bash +pnpm add @timesafari/daily-notification-plugin +``` + +--- + +## Platform Setup + +### iOS + +1. **Add to `Info.plist`:** + +```xml +BGTaskSchedulerPermittedIdentifiers + + com.timesafari.dailynotification.fetch + +``` + +2. **Register background task in `AppDelegate.swift`:** + +```swift +import BackgroundTasks + +func application(_ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + BGTaskScheduler.shared.register(forTaskWithIdentifier: "com.timesafari.dailynotification.fetch", + using: nil) { task in + // Handle background fetch task + } + return true +} +``` + +### Android + +1. **Add permissions to `AndroidManifest.xml`:** + +```xml + + + +``` + +2. **Register WorkManager in `Application.kt`:** + +```kotlin +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 + +```typescript +import { DailyNotification } from '@timesafari/daily-notification-plugin'; +``` + +### 2. Request Permission + +```typescript +const { state } = await DailyNotification.requestPermission(); +if (state !== 'granted') { + console.error('Notification permission denied'); + return; +} +``` + +### 3. Create a Schedule + +```typescript +const { schedule } = await DailyNotification.createSchedule({ + id: 'morning-notification', + kind: 'notify', + clockTime: '09:00', + enabled: true +}); +``` + +### 4. Verify Schedule + +```typescript +const { schedules } = await DailyNotification.getSchedules(); +console.log('Active schedules:', schedules); +``` + +--- + +## Next Steps + +- **[Quick Start Guide](./examples/QUICK_START.md)** — Minimal working example +- **[Common Patterns](./examples/COMMON_PATTERNS.md)** — Common integration patterns +- **[Integration Guide](./integration/INTEGRATION_GUIDE.md)** — Full integration guide +- **[Troubleshooting](./TROUBLESHOOTING.md)** — Common issues and solutions + +--- + +## Authoritative Documentation + +- **[Documentation Index](./00-INDEX.md)** — Complete documentation navigation +- **[System Invariants](./SYSTEM_INVARIANTS.md)** — Enforced system invariants +- **[CI Usage](../ci/README.md)** — Local CI documentation (`./ci/run.sh`) + +--- + +## Support + +For issues, questions, or contributions: + +1. Check [Troubleshooting Guide](./TROUBLESHOOTING.md) +2. Review [System Invariants](./SYSTEM_INVARIANTS.md) +3. Check [Progress Documentation](./progress/00-STATUS.md) for current status + +--- + +**See also:** +- [README.md](../README.md) — Complete plugin documentation +- [Performance Characteristics](./PERFORMANCE.md) — Performance expectations +