feat: 增强通知功能及用户体验
- 在 Bootstrapper 组件中新增通知服务初始化逻辑,注册每日午餐提醒 - 在 CoachScreen 中优化欢迎消息生成逻辑,整合用户配置文件数据 - 更新 GoalsScreen 组件,优化目标创建时的通知设置逻辑 - 在 NotificationTest 组件中添加调试通知状态功能,提升开发便利性 - 新增 NutritionNotificationHelpers 中的午餐提醒功能,支持每日提醒设置 - 更新相关文档,详细描述新功能和使用方法
This commit is contained in:
@@ -27,6 +27,7 @@ export interface UseNotificationsReturn {
|
||||
sendWorkoutReminder: (title: string, body: string, date?: Date) => Promise<string>;
|
||||
sendGoalAchievement: (title: string, body: string) => Promise<string>;
|
||||
sendMoodCheckinReminder: (title: string, body: string, date?: Date) => Promise<string>;
|
||||
debugNotificationStatus: () => Promise<void>;
|
||||
}
|
||||
|
||||
export const useNotifications = (): UseNotificationsReturn => {
|
||||
@@ -134,6 +135,10 @@ export const useNotifications = (): UseNotificationsReturn => {
|
||||
}
|
||||
}, []);
|
||||
|
||||
const debugNotificationStatus = useCallback(async () => {
|
||||
return notificationService.debugNotificationStatus();
|
||||
}, []);
|
||||
|
||||
// 组件挂载时自动初始化
|
||||
useEffect(() => {
|
||||
initialize();
|
||||
@@ -153,5 +158,6 @@ export const useNotifications = (): UseNotificationsReturn => {
|
||||
sendWorkoutReminder,
|
||||
sendGoalAchievement,
|
||||
sendMoodCheckinReminder,
|
||||
debugNotificationStatus,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user