Skip to content
Merged
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
19 changes: 18 additions & 1 deletion FoodDiary/Presentation/Sources/MyPage/MyPageViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,11 @@ extension MyPageViewController: UITableViewDelegate {

switch row {
case .notificationSetting:
openAppSettings()
if viewModel.state.isNotificationEnabled {
showNotificationDisableConfirmAlert()
} else {
openAppSettings()
}
case .privacy:
openExternalLink("https://www.notion.so/enebin/311c690fca2b80bc8c89c5f7cc5cb35c?source=copy_link")
case .customerInquiry:
Expand All @@ -442,6 +446,19 @@ extension MyPageViewController: UITableViewDelegate {
present(alert, animated: true)
}

private func showNotificationDisableConfirmAlert() {
let alert = UIAlertController(
title: "알림을 끄시겠어요?",
message: "알림을 끄면 AI 분석결과와 기록 리마인드 알림을 받아 볼 수 없어요.",
preferredStyle: .alert
)
alert.addAction(UIAlertAction(title: "취소", style: .cancel))
alert.addAction(UIAlertAction(title: "설정으로 이동", style: .default) { [weak self] _ in
self?.openAppSettings()
})
present(alert, animated: true)
}

private func openAppSettings() {
guard let url = URL(string: UIApplication.openSettingsURLString) else { return }
UIApplication.shared.open(url)
Expand Down
Loading