Notifications + AsyncStorage

This commit is contained in:
Teodor
2026-04-22 20:58:00 +02:00
parent 6b298633bc
commit 4947d012c0
20 changed files with 580 additions and 61 deletions

15
lib/asyncStorage.ts Normal file
View File

@@ -0,0 +1,15 @@
import AsyncStorage from '@react-native-async-storage/async-storage';
const notificationKey = (aId: string) => `assignment_notification_${aId}`;
export async function SaveAssignmentNotificationId(aId: string, notificationId: string) {
await AsyncStorage.setItem(notificationKey(aId), notificationId);
}
export async function GetAssignmentNotificationId(aId: string) {
return await AsyncStorage.getItem(notificationKey(aId));
}
export async function RemoveAssignmentNotificationId(aId: string) {
await AsyncStorage.removeItem(notificationKey(aId));
}