Skip to content

Commit 7b8e8f0

Browse files
authored
feat - 푸시알림 토큰 발급 및 테스트 (#13)
* feat: 인증 토큰 관리 개선 및 세션 갱신 로직 추가 * feat: 폰트 적용 * feat: 하단 여백 추가 * feat: expo-notification 추가 및 적용 * feat: 일반로그인 이후 유저정보입력페이지 라우팅
1 parent 306cabe commit 7b8e8f0

File tree

9 files changed

+331
-85
lines changed

9 files changed

+331
-85
lines changed

app.config.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,13 @@ export default ({ config }: ConfigContext): ExpoConfig => ({
7373

7474
// ===== 기타 =====
7575
scheme: 'frontend',
76-
plugins: ['expo-router'],
76+
plugins: [
77+
'expo-router',
78+
[
79+
'expo-notifications',
80+
{
81+
mode: 'development',
82+
},
83+
],
84+
],
7785
});

app/index.tsx

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import CalendarPage from '@/components/CalendarPage';
1212
import SettingsSheet from '@/components/SettingsSheet';
1313
import LoginScreen from '@/components/LoginScreen';
1414
import { useAuth } from '@/providers/AuthProvider';
15+
import { registerForPushNotificationsAsync } from '@/services/pushNotifications';
1516
import { ProfileApiError, updateUserProfile } from '@/services/userProfileService';
1617

1718
const HAS_ONBOARDED_KEY = 'hasOnboarded';
@@ -61,6 +62,21 @@ export default function Home() {
6162
load();
6263
}, []);
6364

65+
useEffect(() => {
66+
const registerPushToken = async () => {
67+
try {
68+
const token = await registerForPushNotificationsAsync();
69+
if (token) {
70+
console.log('Expo push token:', token);
71+
}
72+
} catch (error) {
73+
console.warn('Failed to register for push notifications', error);
74+
}
75+
};
76+
77+
registerPushToken();
78+
}, []);
79+
6480
useEffect(() => {
6581
if (isSignedIn) return;
6682
setIsSettingsOpen(false);
@@ -88,6 +104,10 @@ export default function Home() {
88104
setNeedsOnboarding(true);
89105
}, []);
90106

107+
const handleSignInSuccess = useCallback(() => {
108+
setNeedsProfileSetup(true);
109+
}, []);
110+
91111
const handleOnboardingComplete = () => {
92112
setNeedsOnboarding(false);
93113
void persistHasOnboarded();
@@ -148,7 +168,12 @@ export default function Home() {
148168
}
149169

150170
if (!isSignedIn) {
151-
return <LoginScreen onSignUpSuccess={handleSignUpSuccess} />;
171+
return (
172+
<LoginScreen
173+
onSignUpSuccess={handleSignUpSuccess}
174+
onSignInSuccess={handleSignInSuccess}
175+
/>
176+
);
152177
}
153178

154179
const showOnboarding = needsOnboarding && !needsProfileSetup;

frontend/ios/Pods/Target Support Files/Pods-app/ExpoModulesProvider.swift

Lines changed: 0 additions & 52 deletions
This file was deleted.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
"buffer": "^6.0.3",
2323
"expo": "~54.0.29",
2424
"expo-constants": "^18.0.12",
25+
"expo-device": "~8.0.10",
2526
"expo-font": "^14.0.10",
27+
"expo-notifications": "~0.32.15",
2628
"expo-router": "^6.0.19",
2729
"expo-status-bar": "~3.0.9",
2830
"nativewind": "^4.2.1",

0 commit comments

Comments
 (0)