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
29 changes: 28 additions & 1 deletion Projects/App/Sources/Reducer/AppCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ struct AppCoordinator {
pushClient: pushClient,
notificationClient: notificationClient
),
requestNotificationAuthorizationIfNeededEffect(
pushClient: pushClient,
notificationClient: notificationClient
),
subscribeTokenRefreshEffect(
pushClient: pushClient,
notificationClient: notificationClient
Expand Down Expand Up @@ -348,7 +352,7 @@ private func registerFCMTokenEffect(
// 1. 현재 권한 상태 확인
let settings = await UNUserNotificationCenter.current().notificationSettings()

// 이미 권한이 허용된 경우에만 등록 (notDetermined/denied는 온보딩 완료 시점에서 처리)
// 이미 권한이 허용된 경우에만 등록 (notDetermined는 별도 fallback/온보딩에서 처리)
guard settings.authorizationStatus == .authorized else { return }

// 3. APNS 등록 및 FCM 토큰 획득
Expand All @@ -364,6 +368,29 @@ private func registerFCMTokenEffect(
}
}

private func requestNotificationAuthorizationIfNeededEffect(
pushClient: PushClient,
notificationClient: NotificationClient
) -> Effect<AppCoordinator.Action> {
.run { send in
let settings = await UNUserNotificationCenter.current().notificationSettings()
guard settings.authorizationStatus == .notDetermined else { return }

let granted = (try? await pushClient.requestAuthorization()) ?? false
guard granted else { return }

await pushClient.registerForRemoteNotifications()

guard let token = try? await pushClient.getFCMToken(),
let deviceId = await UIDevice.current.identifierForVendor?.uuidString else {
return
}

try? await notificationClient.registerFCMToken(token, deviceId)
await send(.registerFCMTokenCompleted)
}
}

private func subscribeTokenRefreshEffect(
pushClient: PushClient,
notificationClient: NotificationClient
Expand Down
5 changes: 2 additions & 3 deletions Projects/Feature/Settings/Sources/Settings/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,7 @@ private extension SettingsView {
} label: {
Image.Icon.Symbol.edit
.resizable()
.renderingMode(.template)
.frame(width: 24, height: 24)
.foregroundStyle(Color.Gray.gray500)
}
.frame(width: 44, height: 44)
}
Expand All @@ -139,17 +137,18 @@ private extension SettingsView {
nicknameTextField
.frame(maxWidth: .infinity)
}
.padding(.bottom, Spacing.spacing9)
}

var nicknameTextField: some View {
TXTextField(
text: $store.nickname,
placeholderText: "닉네임을 입력해 주세요.",
isFocused: $isTextFieldFocused,
submitLabel: .done,
tintColor: Color.Gray.gray500,
subText: .init(text: "닉네임 2-8자", state: validationState)
)
.focused($isTextFieldFocused)
.onAppear {
isTextFieldFocused = true
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
{
"images" : [
{
"filename" : "ic_edit.svg",
"idiom" : "universal"
"filename" : "ic_edit.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_edit@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_edit@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading