Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,13 @@ export default ({ config }: ConfigContext): ExpoConfig => ({

// ===== 기타 =====
scheme: 'frontend',
plugins: ['expo-router'],
plugins: [
'expo-router',
[
'expo-notifications',
{
mode: 'development',
},
Comment on lines +79 to +82
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The expo-notifications plugin is configured with mode set to 'development'. This mode setting should typically be changed to 'production' for production builds. Consider making this configurable based on the build environment (development vs production) rather than hardcoding it to 'development'.

Copilot uses AI. Check for mistakes.
],
],
});
27 changes: 26 additions & 1 deletion app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import CalendarPage from '@/components/CalendarPage';
import SettingsSheet from '@/components/SettingsSheet';
import LoginScreen from '@/components/LoginScreen';
import { useAuth } from '@/providers/AuthProvider';
import { registerForPushNotificationsAsync } from '@/services/pushNotifications';
import { ProfileApiError, updateUserProfile } from '@/services/userProfileService';

const HAS_ONBOARDED_KEY = 'hasOnboarded';
Expand Down Expand Up @@ -61,6 +62,21 @@ export default function Home() {
load();
}, []);

useEffect(() => {
const registerPushToken = async () => {
try {
const token = await registerForPushNotificationsAsync();
if (token) {
console.log('Expo push token:', token);
}
} catch (error) {
console.warn('Failed to register for push notifications', error);
}
};

registerPushToken();
}, []);
Comment on lines +65 to +78
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The push notification token registration is attempted on every app start regardless of whether the user is signed in. This token should likely be sent to the backend server and associated with the user's account. Consider moving this registration to occur after successful sign-in, or conditionally execute it only when the user is authenticated. Currently, the token is only logged to the console and not persisted or sent to any backend service.

Copilot uses AI. Check for mistakes.

useEffect(() => {
if (isSignedIn) return;
setIsSettingsOpen(false);
Expand Down Expand Up @@ -88,6 +104,10 @@ export default function Home() {
setNeedsOnboarding(true);
}, []);

const handleSignInSuccess = useCallback(() => {
setNeedsProfileSetup(true);
}, []);

const handleOnboardingComplete = () => {
setNeedsOnboarding(false);
void persistHasOnboarded();
Expand Down Expand Up @@ -148,7 +168,12 @@ export default function Home() {
}

if (!isSignedIn) {
return <LoginScreen onSignUpSuccess={handleSignUpSuccess} />;
return (
<LoginScreen
onSignUpSuccess={handleSignUpSuccess}
onSignInSuccess={handleSignInSuccess}
/>
);
}

const showOnboarding = needsOnboarding && !needsProfileSetup;
Expand Down

This file was deleted.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
"buffer": "^6.0.3",
"expo": "~54.0.29",
"expo-constants": "^18.0.12",
"expo-device": "~8.0.10",
"expo-font": "^14.0.10",
"expo-notifications": "~0.32.15",
"expo-router": "^6.0.19",
"expo-status-bar": "~3.0.9",
"nativewind": "^4.2.1",
Expand Down
Loading
Loading