Files
daily-notification-plugin/android
Matthew Raymer 50b08401d0 fix(android): resolve MainActivity ClassNotFoundException and add exact alarm permission check
- Fix MainActivity ClassNotFoundException by using dynamic package launcher intent
  - Replace hardcoded MainActivity class references with getLaunchIntent() helper
  - Uses packageManager.getLaunchIntentForPackage() to work with any host app
  - Removes dependency on specific MainActivity package/class name
  - Fixes 3 occurrences in NotifyReceiver.kt (alarm clock, notification click, reminder click)

- Add exact alarm permission check before scheduling (Android 12+)
  - Add canScheduleExactAlarms() helper to check SCHEDULE_EXACT_ALARM permission
  - Check permission before scheduling exact alarms in scheduleExactNotification()
  - Gracefully fall back to inexact alarms when permission not granted
  - Prevents SecurityException and provides clear logging

- Bump version to 1.0.2

Fixes:
- ClassNotFoundException when plugin tries to resolve hardcoded MainActivity path
- SecurityException on Android 12+ when exact alarm permission not granted
- Plugin now works with any host app regardless of MainActivity package/class

All changes maintain backward compatibility and improve reliability.
2025-11-10 03:52:35 +00:00
..