-
Notifications
You must be signed in to change notification settings - Fork 0
feat - 푸시알림 토큰 발급 및 테스트 #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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'; | ||
|
|
@@ -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
|
||
|
|
||
| useEffect(() => { | ||
| if (isSignedIn) return; | ||
| setIsSettingsOpen(false); | ||
|
|
@@ -88,6 +104,10 @@ export default function Home() { | |
| setNeedsOnboarding(true); | ||
| }, []); | ||
|
|
||
| const handleSignInSuccess = useCallback(() => { | ||
| setNeedsProfileSetup(true); | ||
| }, []); | ||
|
|
||
| const handleOnboardingComplete = () => { | ||
| setNeedsOnboarding(false); | ||
| void persistHasOnboarded(); | ||
|
|
@@ -148,7 +168,12 @@ export default function Home() { | |
| } | ||
|
|
||
| if (!isSignedIn) { | ||
| return <LoginScreen onSignUpSuccess={handleSignUpSuccess} />; | ||
| return ( | ||
| <LoginScreen | ||
| onSignUpSuccess={handleSignUpSuccess} | ||
| onSignInSuccess={handleSignInSuccess} | ||
| /> | ||
| ); | ||
| } | ||
|
|
||
| const showOnboarding = needsOnboarding && !needsProfileSetup; | ||
|
|
||
This file was deleted.
There was a problem hiding this comment.
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'.