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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user