Skip to content

Port native reminder creation to Flutter agent #31

Description

@SebastianBoehler

Context

The previous Android app implemented reminders with AlarmManager, JSON persistence, boot rescheduling, and foreground services. The Flutter migration copied the Java reminder classes into the Android runner, but reminder creation is not yet exposed as a normal Flutter/Dart assistant tool. iOS already has a basic createReminder bridge method using local notifications.

Relevant existing code:

  • app/src/main/java/com/example/studyOS/Reminder/ReminderManager.java
  • app/src/main/java/com/example/studyOS/Reminder/ReminderReceiver.java
  • app/src/main/java/com/example/studyOS/Reminder/ReminderService.java
  • flutter_app/android/app/src/main/java/com/example/studyOS/Reminder/ReminderManager.java
  • flutter_app/android/app/src/main/AndroidManifest.xml
  • flutter_app/ios/Runner/StudyOSNativeBridge.swift
  • flutter_app/lib/src/native_bridge.dart

Current state

Android old/native behavior:

  • ReminderManager.create(title, time, type, repeat) schedules exact alarms.
  • Reminders are persisted in reminders.json.
  • BOOT_COMPLETED reschedules reminders.
  • ReminderService can wake the app, prepare the assistant environment, and trigger assistant behavior for reminders.

Flutter migration state:

  • Android manifest already includes reminder receiver/service permissions.
  • Android native initialization calls ReminderManager.get().init(applicationContext).
  • iOS bridge exposes createReminder with title and secondsFromNow.
  • Dart NativeBridge does not yet expose cross-platform reminder creation.
  • The assistant tool catalog does not yet include a reminder tool.

Proposed scope

Expose reminder creation from Flutter as an assistant/native tool while keeping platform-specific scheduling behind platform channels.

Suggested tool shape:

  • create_reminder
  • required: title, time
  • optional: type (REMINDER, ALARM, MORNING_ROUTINE on Android where supported), repeat (ONCE, DAILY, WEEKLY where supported)

Implementation notes:

  • Prefer passing an ISO timestamp from Dart to native code; avoid fragile natural-language parsing in the native bridge.
  • Keep natural-language parsing in the assistant/model layer or a tested Dart utility if needed.
  • Return exact native errors for missing notification/exact-alarm permission instead of swallowing exceptions.

Acceptance criteria

  • Flutter NativeBridge exposes createReminder with a stable argument contract.
  • Android MethodChannel schedules reminders through the copied ReminderManager.
  • iOS path either reuses the existing local notification bridge or is aligned with the same Dart method shape.
  • Dart assistant tool catalog includes create_reminder and routes it through the native bridge.
  • Unsupported repeat/type combinations return explicit platform errors.
  • Existing Android boot rescheduling remains intact.
  • User-facing copy clearly distinguishes reminders, alarms, and unsupported morning-routine behavior.

Platform/security notes

  • Android exact alarms may require user approval depending on API/device policy.
  • iOS local notifications are not equivalent to Android alarm-clock/foreground-service behavior.
  • Background assistant activation should be conservative and visible; do not silently start long-running mic/listening behavior from a reminder.

Test expectations

  • Add Dart tests for argument validation and tool routing.
  • Add Android manual QA for one-time reminder, repeating reminder, and reboot/reschedule where feasible.
  • Add iOS manual QA for notification permission denial and successful local notification scheduling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions