Got some new errors. but close to having stuff
This commit is contained in:
26
components/services/securestorage/UserData.tsx
Normal file
26
components/services/securestorage/UserData.tsx
Normal file
@ -0,0 +1,26 @@
|
||||
import * as SecureStore from 'expo-secure-store';
|
||||
|
||||
type UserData = {
|
||||
appleId: string;
|
||||
appleEmail: string;
|
||||
fullName: string;
|
||||
pushToken: string;
|
||||
};
|
||||
|
||||
export const saveUserData = async (userData: any) => {
|
||||
try {
|
||||
await SecureStore.setItemAsync('userData', JSON.stringify(userData));
|
||||
} catch (error) {
|
||||
console.error('Error saving user data:', error);
|
||||
}
|
||||
};
|
||||
|
||||
export const getUserData = async () => {
|
||||
try {
|
||||
const userData = await SecureStore.getItemAsync('userData');
|
||||
return userData ? JSON.parse(userData) : null;
|
||||
} catch (error) {
|
||||
console.error('Error getting user data:', error);
|
||||
return null;
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user