Refactor: Remove background task management and related hooks
- Deleted `useBackgroundTasks.ts` hook and its associated logic for managing background tasks. - Removed `backgroundTaskManager.ts` service and all related task definitions and registrations. - Cleaned up `Podfile.lock` and `package.json` to remove unused dependencies related to background tasks. - Updated iOS project files to eliminate references to removed background task components. - Added new background fetch identifier in `Info.plist` for future use.
This commit is contained in:
@@ -8,7 +8,6 @@ import 'react-native-reanimated';
|
||||
import PrivacyConsentModal from '@/components/PrivacyConsentModal';
|
||||
import { useAppDispatch, useAppSelector } from '@/hooks/redux';
|
||||
import { clearAiCoachSessionCache } from '@/services/aiCoachSession';
|
||||
import { backgroundTaskManager } from '@/services/backgroundTaskManager';
|
||||
import { notificationService } from '@/services/notifications';
|
||||
import { store } from '@/store';
|
||||
import { rehydrateUser, setPrivacyAgreed } from '@/store/userSlice';
|
||||
@@ -31,16 +30,6 @@ function Bootstrapper({ children }: { children: React.ReactNode }) {
|
||||
await dispatch(rehydrateUser());
|
||||
setUserDataLoaded(true);
|
||||
};
|
||||
|
||||
const initializeBackgroundTasks = async () => {
|
||||
try {
|
||||
await backgroundTaskManager.initialize();
|
||||
console.log('后台任务管理器初始化成功');
|
||||
} catch (error) {
|
||||
console.error('后台任务管理器初始化失败:', error);
|
||||
}
|
||||
};
|
||||
|
||||
const initializeNotifications = async () => {
|
||||
try {
|
||||
// 初始化通知服务
|
||||
@@ -52,7 +41,6 @@ function Bootstrapper({ children }: { children: React.ReactNode }) {
|
||||
};
|
||||
|
||||
loadUserData();
|
||||
initializeBackgroundTasks();
|
||||
initializeNotifications();
|
||||
// 冷启动时清空 AI 教练会话缓存
|
||||
clearAiCoachSessionCache();
|
||||
|
||||
Reference in New Issue
Block a user