Created: - docs/examples/QUICK_START.md: Minimal working example with platform setup - docs/examples/COMMON_PATTERNS.md: Common patterns (error handling, scheduling, recovery) Updated docs/00-INDEX.md to link examples section. Verification: - Documentation created and linked ✅ - Examples follow best practices ✅
59 lines
1.3 KiB
Markdown
59 lines
1.3 KiB
Markdown
# Quick Start Guide
|
|
|
|
**Purpose:** Minimal working example for Daily Notification Plugin.
|
|
**Owner:** Development Team
|
|
**Last Updated:** 2025-12-22
|
|
**Status:** active
|
|
|
|
---
|
|
|
|
## Minimal Working Example
|
|
|
|
```typescript
|
|
import { DailyNotification } from '@timesafari/daily-notification-plugin';
|
|
|
|
// 1. Request permission
|
|
const { state } = await DailyNotification.requestPermission();
|
|
if (state !== 'granted') {
|
|
console.error('Permission denied');
|
|
return;
|
|
}
|
|
|
|
// 2. Create schedule
|
|
const { schedule } = await DailyNotification.createSchedule({
|
|
id: 'daily-morning',
|
|
kind: 'notify',
|
|
clockTime: '09:00',
|
|
enabled: true
|
|
});
|
|
|
|
// 3. Verify schedule
|
|
const { schedules } = await DailyNotification.getSchedules();
|
|
console.log('Active schedules:', schedules);
|
|
```
|
|
|
|
## Platform Setup
|
|
|
|
### iOS
|
|
Add to `Info.plist`:
|
|
```xml
|
|
<key>BGTaskSchedulerPermittedIdentifiers</key>
|
|
<array>
|
|
<string>com.timesafari.dailynotification.fetch</string>
|
|
</array>
|
|
```
|
|
|
|
### Android
|
|
Add to `AndroidManifest.xml`:
|
|
```xml
|
|
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
|
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
|
|
```
|
|
|
|
---
|
|
|
|
**See also:**
|
|
- [Common Patterns](./COMMON_PATTERNS.md) — Common integration patterns
|
|
- [Integration Guide](../integration/INTEGRATION_GUIDE.md) — Full integration guide
|
|
|