Files
daily-notification-plugin/docs/GETTING_STARTED.md
Jose Olarte III d8a0eaf413 refactor(android,ios): rename package com.timesafari to org.timesafari.dailynotification
- 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.
2026-03-12 14:26:07 +08:00

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

  1. Add to Info.plist:
<key>BGTaskSchedulerPermittedIdentifiers</key>
<array>
  <string>org.timesafari.dailynotification.fetch</string>
</array>
  1. 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

  1. 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: The USE_EXACT_ALARM permission 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 uses SCHEDULE_EXACT_ALARM instead, which is sufficient for scheduling daily notifications.

  1. 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


Authoritative Documentation


Support

For issues, questions, or contributions:

  1. Check Troubleshooting Guide
  2. Review System Invariants
  3. Check Progress Documentation for current status

See also: