feat: Refactor MoodCalendarScreen to use dayjs for date handling and improve calendar data generation

feat: Update FitnessRingsCard to navigate to fitness rings detail page on press

feat: Modify NutritionRadarCard to enhance UI and add haptic feedback on actions

feat: Add FITNESS_RINGS_DETAIL route for navigation

fix: Adjust minimum fetch interval in BackgroundTaskManager for background tasks

feat: Implement haptic feedback utility functions for better user experience

feat: Extend health permissions to include Apple Exercise Time and Apple Stand Time

feat: Add functions to fetch hourly activity, exercise, and stand data for improved health tracking

feat: Enhance user preferences to manage fitness exercise minutes and active hours info dismissal
This commit is contained in:
richarjiang
2025-09-05 15:32:34 +08:00
parent 460a7e4289
commit 83805a4b07
9 changed files with 1337 additions and 79 deletions

View File

@@ -38,7 +38,7 @@ export class BackgroundTaskManager {
try {
// 配置后台获取
const status = await BackgroundFetch.configure({
minimumFetchInterval: 15000, // 最小间隔15分钟iOS 实际控制间隔)
minimumFetchInterval: 15, // 最小间隔15分钟iOS 实际控制间隔)
}, async (taskId) => {
console.log('[BackgroundFetch] 后台任务执行:', taskId);
await this.executeBackgroundTasks();
@@ -73,6 +73,24 @@ export class BackgroundTaskManager {
return;
}
// 获取用户名
const state = store.getState();
const userName = state.user.profile?.name || '朋友';
// 发送测试通知
const Notifications = await import('expo-notifications');
await Notifications.scheduleNotificationAsync({
content: {
title: '测试通知',
body: `你好 ${userName}!这是一条测试消息,用于验证通知功能是否正常工作。`,
data: { type: 'test_notification', timestamp: Date.now() },
sound: true,
priority: Notifications.AndroidNotificationPriority.HIGH,
},
trigger: null, // 立即发送
});
// 执行喝水提醒检查任务
await this.executeWaterReminderTask();
@@ -375,6 +393,7 @@ export class BackgroundTaskManager {
console.error('站立提醒后台任务测试失败:', error);
}
}
}
/**