Fix: Android reminder toast and boot recovery
- Toast/notify: Keep dialog open until schedule flow finishes so success/error $notify runs while component is mounted (fixes missing toast on Android). Add success/error notify in edit-reminder callback (AccountViewView). - Boot recovery: Split BootReceiver intent-filter so BOOT_COMPLETED and LOCKED_BOOT_COMPLETED use a filter without <data>; use a separate filter with <data scheme="package"/> for MY_PACKAGE_REPLACED/PACKAGE_REPLACED. Boot broadcasts have no Uri and were not matching the previous filter, so daily reminder now reschedules after device restart.
This commit is contained in:
@@ -64,6 +64,8 @@
|
|||||||
android:exported="false"
|
android:exported="false"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<!-- BootReceiver: reschedule daily notification after device restart.
|
||||||
|
Two intent-filters: BOOT_COMPLETED has no Uri, so must not share a filter with <data scheme="package"/> or the boot broadcast never matches. -->
|
||||||
<receiver
|
<receiver
|
||||||
android:name="com.timesafari.dailynotification.BootReceiver"
|
android:name="com.timesafari.dailynotification.BootReceiver"
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
@@ -72,6 +74,8 @@
|
|||||||
<intent-filter android:priority="1000">
|
<intent-filter android:priority="1000">
|
||||||
<action android:name="android.intent.action.LOCKED_BOOT_COMPLETED" />
|
<action android:name="android.intent.action.LOCKED_BOOT_COMPLETED" />
|
||||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||||
|
</intent-filter>
|
||||||
|
<intent-filter android:priority="1000">
|
||||||
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
|
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
|
||||||
<action android:name="android.intent.action.PACKAGE_REPLACED" />
|
<action android:name="android.intent.action.PACKAGE_REPLACED" />
|
||||||
<data android:scheme="package" />
|
<data android:scheme="package" />
|
||||||
|
|||||||
@@ -665,15 +665,15 @@ export default class PushNotificationPermission extends Vue {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles the main action button click
|
* Handles the main action button click
|
||||||
|
* Close only after async flow completes so success/error $notify runs while component is mounted (fixes Android).
|
||||||
*/
|
*/
|
||||||
handleTurnOnNotifications() {
|
async handleTurnOnNotifications() {
|
||||||
this.close();
|
|
||||||
// Route to native or web notification flow based on platform
|
|
||||||
if (this.isNativePlatform) {
|
if (this.isNativePlatform) {
|
||||||
this.turnOnNativeNotifications();
|
await this.turnOnNativeNotifications();
|
||||||
} else {
|
} else {
|
||||||
this.turnOnNotifications();
|
await this.turnOnNotifications();
|
||||||
}
|
}
|
||||||
|
this.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1332,7 +1332,19 @@ export default class AccountViewView extends Vue {
|
|||||||
});
|
});
|
||||||
this.notifyingReminderMessage = message || "";
|
this.notifyingReminderMessage = message || "";
|
||||||
this.notifyingReminderTime = timeText;
|
this.notifyingReminderTime = timeText;
|
||||||
|
this.notify.success("Daily reminder updated.", TIMEOUTS.STANDARD);
|
||||||
|
} else {
|
||||||
|
this.notify.error(
|
||||||
|
"Failed to update reminder. Please try again.",
|
||||||
|
TIMEOUTS.STANDARD,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
} catch (err) {
|
||||||
|
logger.error("[AccountViewView] Edit reminder schedule failed:", err);
|
||||||
|
this.notify.error(
|
||||||
|
"Failed to update reminder. Please try again.",
|
||||||
|
TIMEOUTS.STANDARD,
|
||||||
|
);
|
||||||
} finally {
|
} finally {
|
||||||
this.editReminderScheduleInProgress = false;
|
this.editReminderScheduleInProgress = false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user