feat: 添加后台任务测试通知功能,优化滑动删除交互体验

This commit is contained in:
richarjiang
2025-09-04 16:12:27 +08:00
parent 05a643a9e6
commit a4a0e07227
3 changed files with 44 additions and 20 deletions

View File

@@ -424,6 +424,19 @@ export default function ExploreScreen() {
handler: async () => {
try {
console.log('后台任务:更新健康数据和检查压力水平...');
// 发送测试通知,验证后台任务是否执行
await notificationService.sendImmediateNotification({
title: '后台任务测试 🔔',
body: `任务执行时间: ${new Date().toLocaleTimeString('zh-CN')}`,
data: {
type: 'background_task_test',
timestamp: new Date().toISOString(),
},
sound: true,
priority: 'high'
});
// 后台任务只更新健康数据,强制刷新以获取最新数据
await loadHealthData(undefined, true);