WIP: Change DailyNotificationReceiver to exported=true for AlarmManager broadcasts

The DailyNotificationReceiver was not being triggered when scheduled alarms
fired, preventing notifications from appearing at the scheduled time.

Changed android:exported from "false" to "true" to allow AlarmManager
broadcasts to reach the receiver, especially when the app is closed or
the device is in doze mode.

This is a work-in-progress change to diagnose why notifications aren't
firing. The receiver should log "DN|RECEIVE_START" when triggered, but
we were not seeing these logs even when alarms were scheduled.

Next steps:
- Test if receiver is now triggered when alarm fires
- Verify notifications appear at scheduled time
- Consider adding permission check if keeping exported=true for security
This commit is contained in:
Matthew
2026-02-02 06:18:32 -08:00
parent d0878507a6
commit 80cc09de95
4 changed files with 349 additions and 51 deletions

View File

@@ -44,15 +44,18 @@
</activity>
<!-- Daily Notification Plugin Receivers (must be inside application) -->
<!-- DailyNotificationReceiver: Handles alarm-triggered notifications -->
<!-- Note: exported="true" allows AlarmManager to trigger this receiver -->
<receiver
android:name="com.timesafari.dailynotification.DailyNotificationReceiver"
android:enabled="true"
android:exported="false">
android:exported="true">
<intent-filter>
<action android:name="com.timesafari.daily.NOTIFICATION" />
</intent-filter>
</receiver>
<!-- NotifyReceiver: Handles notification delivery -->
<receiver
android:name="com.timesafari.dailynotification.NotifyReceiver"
android:enabled="true"

View File

@@ -68,8 +68,8 @@ public class MainActivity extends BridgeActivity {
registerPlugin(SharedImagePlugin.class);
// Register DailyNotification plugin
// TODO: Uncomment when DailyNotificationPlugin Java class is implemented
// registerPlugin(com.timesafari.dailynotification.DailyNotificationPlugin.class);
// Plugin is written in Kotlin but compiles to Java-compatible bytecode
registerPlugin(com.timesafari.dailynotification.DailyNotificationPlugin.class);
// Initialize SQLite
//registerPlugin(SQLite.class);