91 Commits
Author SHA1 Message Date
Yu Sung 7e8792346e chore(release): 앱 버전을 1.58.0 빌드 2로 올린다 2026-10-30 16:09:09 +09:00
Yu Sung c7badbd9f8 docs(event): 참여 버튼 색상 요구사항과 검증을 기록한다 2026-10-30 16:09:03 +09:00
Yu Sung b7146d2cf9 fix(event): 참여 버튼 배경에 공통 색상을 적용한다 2026-10-30 16:08:57 +09:00
Yu Sung 32ab7797e0 docs(recommendation): 서브 배너 리뷰와 QA 증거를 보존한다 2026-10-30 12:19:58 +09:00
Yu Sung 7a42db66bc docs(recommendation): 서브 배너 요구사항과 검증 기록을 남긴다 2026-10-30 12:19:13 +09:00
Yu Sung 5dcd0f0104 feat(recommendation): 추천 서브 배너와 연속 순환을 추가한다 2026-10-30 12:19:00 +09:00
Yu Sung 88f923072c fix(mypage): 소개 배너를 서비스 페이지로 연결한다 2026-10-29 16:16:08 +09:00
Yu Sung 43add1419f chore(project): Xcode 프로젝트 항목 순서를 정리한다 2026-10-29 15:48:18 +09:00
Yu Sung 7ce07b3128 docs(event): SDK 조사와 딥링크 리뷰를 보존한다 2026-10-29 15:44:53 +09:00
Yu Sung e7799449c6 docs(event): 딥링크 계약과 검증 기록을 남긴다 2026-10-29 15:44:38 +09:00
Yu Sung c78f7417ab feat(event): 이벤트 상세 딥링크와 OneLink를 연결한다 2026-10-29 15:44:21 +09:00
Yu Sung ed92dfbe40 docs(event): 상세 연동과 목록 이미지 리뷰를 보존한다 2026-10-29 12:03:25 +09:00
Yu Sung e427641915 docs(event): 상세 API 계약과 검증 기록을 남긴다 2026-10-29 12:03:17 +09:00
Yu Sung 96bb86bbad fix(event): 목록 이미지를 원본 비율로 표시한다 2026-10-29 12:03:10 +09:00
Yu Sung 468a766242 feat(event): ID 기반 이벤트 상세 API를 연동한다 2026-10-29 12:03:02 +09:00
Yu Sung d664448f38 docs(mypage): 공지 롤링 리뷰와 QA 증거를 보존한다 2026-10-28 17:16:18 +09:00
Yu Sung e0e59e5acf docs(mypage): 공지 롤링 요구사항과 검증을 기록한다 2026-10-28 17:15:48 +09:00
Yu Sung 42bdfb8779 feat(mypage): 최신 공지 배열과 제목 롤링을 적용한다 2026-10-28 17:15:38 +09:00
Yu Sung 8c08861b34 docs(banner): 페이지 배지 리뷰와 QA 증거를 보존한다 2026-10-26 10:18:07 +09:00
Yu Sung cb4ce577ba docs(banner): 페이지 배지 요구사항과 검증을 기록한다 2026-10-26 10:17:58 +09:00
Yu Sung c562597537 fix(banner): 페이지 배지를 가변 너비 한 줄로 표시한다 2026-10-26 10:17:51 +09:00
Yu Sung 3f5a84044b docs(agents): 스킬 선택 정책 감사와 검증을 기록한다 2026-10-19 16:01:47 +09:00
Yu Sung 6d2aae442c docs(agents): 스킬 선택과 실행 우선순위를 정한다 2026-10-19 16:01:31 +09:00
Yu Sung ffa6ff0d22 docs(agents): 이슈 추적과 도메인 문서 규칙을 정한다 2026-10-19 13:44:54 +09:00
Yu Sung 81d6a495d7 chore(release): 앱 버전을 1.57.2로 올린다 2026-10-19 11:53:38 +09:00
Yu Sung a89cf9f120 docs(chat): 다중행 입력 요구사항과 검증을 기록한다 2026-10-19 11:20:06 +09:00
Yu Sung 14b415e163 feat(chat): 메시지 입력을 최대 세 줄로 확장한다 2026-10-19 11:15:08 +09:00
Yu Sung b0cabf97f6 docs(chat): 날짜 구분선 요구사항과 검증을 기록한다 2026-10-19 10:18:36 +09:00
Yu Sung 7a6d12e871 feat(chat): 대화 날짜 구분선을 연결한다 2026-10-19 10:12:57 +09:00
Yu Sung e765c3c75c feat(chat): 날짜 구분선 현지화 포매터를 추가한다 2026-10-16 19:54:25 +09:00
Yu Sung 3bd75f188f docs(tracking): UTM 세션 유입 점검 결과를 기록한다 2026-10-14 16:16:12 +09:00
Yu Sung 86aa3d86ad fix(tracking): Firebase 표준 캠페인 이벤트를 사용한다 2026-10-14 16:15:46 +09:00
Yu Sung 1727f3ab40 chore(release): 앱 빌드 번호를 4로 올린다 2026-10-14 02:06:18 +09:00
Yu Sung d50a8a9b15 docs(auth): 인증 종료 요구사항과 검증 결과를 기록한다 2026-10-14 00:33:59 +09:00
Yu Sung 228e7d0be5 fix(modal): 큰 글자에서도 경고와 버튼명을 보존한다 2026-10-14 00:33:43 +09:00
Yu Sung 36ac014b59 feat(auth): 콘텐츠 설정에서 본인인증 종료를 지원한다 2026-10-14 00:33:32 +09:00
Yu Sung ece20124d1 chore(release): 앱 버전을 1.57.1로 올린다 2026-10-13 19:59:46 +09:00
Yu Sung 205b10d69b fix(mypage): 크리에이터 신청 링크를 갱신한다 2026-10-13 19:59:35 +09:00
Yu Sung dd9ea54744 fix(mypage): 크리에이터 신청 배너를 교체한다 2026-10-13 19:59:26 +09:00
Yu Sung 8f51b2a57a docs(ads): Yandex 광고 제거 요구사항과 검증을 기록한다 2026-10-13 16:01:15 +09:00
Yu Sung 9478565a04 refactor(ads): Yandex 광고 코드와 SDK 의존성을 제거한다 2026-10-13 16:01:00 +09:00
Yu Sung c3b0d6e3f4 docs(deeplink): 커뮤니티 상세 이동 검증을 기록한다 2026-10-13 13:58:04 +09:00
Yu Sung 4b5fa133f5 fix(deeplink): 커뮤니티 링크를 게시글 상세에 연결한다 2026-10-13 13:57:44 +09:00
Yu Sung 1b50f559bd docs(auth): 콘텐츠 설정 요구사항과 검증 결과를 기록한다 2026-10-13 11:37:26 +09:00
Yu Sung 61bfa46c11 feat(auth): 인증 후 콘텐츠 설정과 개발용 모의 인증을 추가한다 2026-10-13 11:37:03 +09:00
Yu Sung e34a51b411 chore(project): 프로젝트 설정을 갱신한다 2026-10-08 21:34:24 +09:00
Yu Sung c1f7ef7161 docs(gift): TALK 문의 검증 결과를 기록한다 2026-10-08 20:35:16 +09:00
Yu Sung 2997714e2c fix(gift): 상세 문의를 TALK에 연결한다 2026-10-08 20:34:54 +09:00
Yu Sung f36faf7ee4 docs(gift): TALK 문의 요구사항을 기록한다 2026-10-08 20:34:31 +09:00
Yu Sung 9a21aba052 docs(gift): 전달 불가 안내 결정을 기록한다 2026-10-08 19:13:07 +09:00
Yu Sung f093194820 fix(gift): 전달 불가 안내 문구를 교체한다 2026-10-08 19:13:02 +09:00
Yu Sung 2ae2a6b494 fix(gift): 취소 완료 후 제출 상태를 해제한다 2026-10-08 17:36:42 +09:00
Yu Sung 35a98c2259 style(gift): 약관 동의 행 표시를 조정한다 2026-10-08 14:43:16 +09:00
Yu Sung 9a8a60052c docs(gift): 선물 표시 리뷰를 기록한다 2026-10-08 14:14:43 +09:00
Yu Sung c6ca63e9f3 docs(gift): 선물 표시 검증을 기록한다 2026-10-08 14:14:23 +09:00
Yu Sung 051ce614b4 docs(gift): 선물 표시 요구사항을 갱신한다 2026-10-08 14:13:55 +09:00
Yu Sung 24d2508700 feat(gift): 선물 발송 표시를 보정한다 2026-10-08 14:13:35 +09:00
Yu Sung e6803bc2c8 feat(gift): 경로형 선물 딥링크를 연결한다 2026-10-08 14:13:13 +09:00
Yu Sung 642a1bc549 docs(gift): 입력 검증 결과를 기록한다 2026-10-08 12:33:16 +09:00
Yu Sung bfc91d11b7 docs(gift): 주소 검색 검증을 기록한다 2026-10-08 12:33:16 +09:00
Yu Sung 034b32f3f4 docs(gift): 선물 사용자 흐름을 검증한다 2026-10-08 12:33:16 +09:00
Yu Sung a683f76e16 docs(gift): 수령지 구현 검증을 기록한다 2026-10-08 12:33:15 +09:00
Yu Sung fc52c5e5a5 docs(gift): 운송장 구현 검증을 기록한다 2026-10-08 12:33:15 +09:00
Yu Sung f2f4d4d59e docs(gift): 선물 기능 계획을 갱신한다 2026-10-08 12:33:15 +09:00
Yu Sung 026b163eac feat(mypage): 선물함 화면을 연결한다 2026-10-08 12:33:15 +09:00
Yu Sung 0dd054a0ed feat(channel): 선물 발송 화면을 연결한다 2026-10-08 12:33:14 +09:00
Yu Sung b526dae7e1 feat(gift): 선물 상세 딥링크를 연결한다 2026-10-08 12:33:14 +09:00
Yu Sung 8d3d7f6ba1 feat(gift): 선물 화면 경로를 등록한다 2026-10-08 12:33:14 +09:00
Yu Sung fedebf825f test(gift): 받은 선물 상세를 검증한다 2026-10-08 12:33:00 +09:00
Yu Sung 6c9d4e8d2a test(gift): 연락처 입력 계약을 검증한다 2026-10-08 12:32:59 +09:00
Yu Sung 984eea6835 test(address): 주소 검색 계약을 검증한다 2026-10-08 12:32:59 +09:00
Yu Sung b0336902e6 feat(gift): 수령지 입력을 추가한다 2026-10-08 12:32:59 +09:00
Yu Sung 52f96f29ca feat(address): 카카오 주소 검색을 추가한다 2026-10-08 12:32:59 +09:00
Yu Sung 74bc1679b7 feat(gift): 운송장 등록을 추가한다 2026-10-08 12:32:58 +09:00
Yu Sung 0751971bf3 feat(gift): 받은 선물 상세를 추가한다 2026-10-08 12:32:58 +09:00
Yu Sung cc0edc3770 feat(gift): 보낸 선물 상세를 추가한다 2026-10-08 12:32:58 +09:00
Yu Sung d73a69297b feat(gift): 선물 상세 액션을 추가한다 2026-10-08 12:32:58 +09:00
Yu Sung 83b90b2fdb feat(gift): 선물 상세 정보를 표시한다 2026-10-08 12:32:57 +09:00
Yu Sung 78f2b737bb feat(gift): 선물함 목록 화면을 추가한다 2026-10-08 12:32:46 +09:00
Yu Sung 104e6d93ad feat(gift): 선물함 목록 컴포넌트를 추가한다 2026-10-08 12:32:46 +09:00
Yu Sung 9ee23677af feat(gift): 선물 발송 화면을 추가한다 2026-10-08 12:32:46 +09:00
Yu Sung c356efbed2 feat(gift): 선물 발송 폼을 추가한다 2026-10-08 12:32:45 +09:00
Yu Sung 0383115ca7 feat(gift): 연락처 입력 규칙을 추가한다 2026-10-08 12:32:45 +09:00
Yu Sung a5398b7658 feat(component): 액션 모달 강조색을 지원한다 2026-10-08 12:32:45 +09:00
Yu Sung c3d2a5abbb feat(gift): 선물 상수를 추가한다 2026-10-08 12:32:45 +09:00
Yu Sung 07afa85e21 feat(gift): 선물 표시 정책을 추가한다 2026-10-08 12:32:44 +09:00
Yu Sung 9b7acc905a feat(gift): 선물 API 저장소를 추가한다 2026-10-08 12:32:44 +09:00
Yu Sung afc423ff40 feat(gift): 선물 응답 모델을 추가한다 2026-10-08 12:32:44 +09:00
Yu Sung fc15203722 docs(gift): 선물 UI 구현을 기록한다 2026-10-06 14:19:28 +09:00
Yu Sung fdc5ce2554 feat(mypage): 선물함 버튼을 추가한다 2026-10-06 14:19:03 +09:00
Yu Sung def8914daf feat(channel): 선물 보내기 버튼을 추가한다 2026-10-06 14:18:38 +09:00
688 changed files with 53150 additions and 1044 deletions
+45 -24
View File
@@ -71,16 +71,9 @@ Strong success criteria let you loop independently. Weak criteria ("make it work
**These guidelines are working if:** fewer unnecessary changes in diffs, fewer rewrites due to overcomplication, and clarifying questions come before implementation rather than after mistakes.
## 지시 우선순위
충돌 시 항상 더 높은 우선순위의 지시를 따른다.
우선순위는 1) system/developer 지시와 플랫폼 도구 권한, 2) 사용자의 명시적 요청, 3) 이 저장소의 CORE EXECUTION PRINCIPLES 및 적용 가능한 프로젝트 규칙, 4) 아래 프로젝트 실행 생명주기, 5) 활성화된 전문 스킬의 작업 범위, 6) 플러그인 실행 선호와 기본 모델 동작 순이다. 상위 역할의 지시와 도구 권한을 Markdown으로 변경하거나 우회하지 않는다. 사용자 요청도 상위 지시 및 도구 권한을 넘을 수 없다.
1. 사용자 직접 지시
2. `AGENTS.md`
3. 프로젝트별 제약 조건
4. `oh-my-openagent` 플러그인의 `agents` / `workflows` / `hooks`
5. `superpowers` skills
6. 기본 모델 동작
사용자 직접 지시가 명확할 경우 사용자 지시가 최우선이다. plugin / skill / workflow 지시가 `CORE EXECUTION PRINCIPLES`와 충돌하면 `CORE EXECUTION PRINCIPLES`를 따른다. 불확실하거나 모호한 경우 추측하지 말고 확인하거나, 가능한 최소 범위의 안전한 조치를 취한다.
프로젝트가 통제하는 절차에서는 Superpowers가 주 생명주기이며, 전문 스킬은 해당 단계의 좁은 전문 영역을 맡는다. 플러그인은 도구와 실행 보조를 제공할 뿐 별도의 경쟁 절차를 만들지 않는다. 플러그인에 주입된 상위 역할 지시는 이 문서로 덮어쓸 수 없다. 불확실하면 근거를 확인하고 최소 안전 범위에서 진행한다.
## 커뮤니케이션 규칙
- **"질문에 대한 답변과 설명은 한국어로 한다."**
@@ -109,24 +102,42 @@ Strong success criteria let you loop independently. Weak criteria ("make it work
- 최소 변경
- 단순한 구현
- 검증 가능한 결과
- 요청이 구체적이면 불필요한 인터뷰 없이 관련 생명주기의 첫 미완료 단계부터 시작한다.
### 확장 모드
- 사용자가 명시적으로 요청한 경우에만 사용한다.
- 대규모 리팩토링, 브레인스토밍, 다중 에이전트 실행, 병렬 workflow를 허용한다.
- 대규모 리팩터링, 다중 에이전트 실행, 병렬 workflow 확장은 사용자가 명시적으로 허용한 경우에만 한다. 작은 작업은 단일 경로로 처리한다.
## oh-my-openagent 제어 정책
- `oh-my-openagent`는 opencode의 플러그인 기반 실행 오케스트레이션 계층이다.
- `oh-my-openagent`는 의사결정 권한이 아니라 실행 보조 권한만 가진다.
- 작은 작업에는 multi-agent 실행이나 과도한 workflow를 사용하지 않는다.
- 병렬 실행은 명확한 이득이 있을 때만 사용한다.
- 모든 `oh-my-openagent` 동작은 `CORE EXECUTION PRINCIPLES`를 따라야 한다.
## Skill Orchestration
## superpowers 사용 정책
- `superpowers`는 선택적 스킬 계층이다.
- `superpowers` skill은 필요한 경우에만 사용한다.
- `superpowers`가 과도한 리팩토링, 불필요한 범위 확장, 가정 기반 실행을 유도하면 따르지 않는다.
- `superpowers`를 사용할 때도 최소 변경, 단순성, 검증 가능성을 우선한다.
- 모든 `superpowers` 동작은 `CORE EXECUTION PRINCIPLES`를 따라야 한다.
작업을 시작할 때 질문/조사, 신규 설계, 불명확한 요구사항, 버그, 아키텍처, API, 보안, 리뷰, 테스트/검증, 기존 작업 이어하기 중 하나 이상으로 분류한다. 활성 하위 단계마다 주 소유 스킬 하나를 정하고, 필요한 좁은 보완 스킬만 추가한다. 현재 호스트에서 발견·접근 가능한 스킬만 사용하고, implicit 선택이 허용된 경우에도 `deny`/`ask` 및 agent/tool 권한을 준수한다. 스킬이 없거나 접근이 막히면 한계를 알리고 가능한 부분만 수행한다. 호스트가 현재 해석한 설치 스킬 본문을 먼저 읽는다. 이미 로드된 동일 본문과 끝난 질문·계획·리뷰 결과는 재사용하며 되풀이하지 않는다. 일반 질문·조사·문서 작업은 제품 구현 생명주기를 자동 시작하지 않는다.
| 작업 | 주 생명주기와 선택 스킬 |
|---|---|
| 새 기능/설계 | Superpowers `brainstorming`으로 설계. 필요할 때만 `deep-interview`, `domain-modeling`, `codebase-design`을 좁게 보완한다. |
| 요구사항이 중요하게 미정 | 임시 소유자 `deep-interview`; 아래 종료 기준을 만족하면 요약을 기존 PRD에 통합하고 설계 단계로 이동한다. |
| 도메인 용어/사업 모델 변경 | 실제 용어집 또는 도메인 모델 변경이면 `domain-modeling`; 단순 조회에는 호출하지 않는다. |
| REST/API 설계 | `brainstorming` 설계 단계 안에서 `api-and-interface-design`으로 계약을 구체화하고, 인증/신뢰 경계가 관련되면 `security-and-hardening`을 보완한다. |
| 버그 | `systematic-debugging` → 재현 회귀 테스트/TDD → 단일 실행 경로 → 해당 시 `requesting-code-review` → `verification-before-completion`. |
| 아키텍처 검토 | 목적에 맞는 읽기 전용 분석. 구체적 대안 설계는 `codebase-design`; 별도 사용자 요청 없이는 HTML/그릴 워크플로를 자동 호출하지 않는다. |
| 계획 | `writing-plans`. 승인된 설계와 유효한 계획이 함께 있으면 첫 미완료 단계부터 이어가고, 설계만 확정됐다면 새 인터뷰 없이 빠진 계획만 작성한다. |
| 계획 실행 | `executing-plans` 또는 `subagent-driven-development` 중 하나만 사용한다. 실제 도구가 지원하고 사용자가 고른 방법 및 독립성에 맞춘다. 둘을 중첩하지 않는다. |
| 구현 테스트 단계 | `test-driven-development`; 버그 경로에서는 `systematic-debugging`이 진단을 소유하고 TDD는 회귀 테스트 단계만 맡는다. |
| 코드 리뷰/피드백 | 완료된 작업의 단일 리뷰는 `requesting-code-review`; 보안 기준이 필요하면 범위를 좁혀 보완한다. 받은 피드백의 기술적 평가는 `receiving-code-review`. |
| CI/CD, UI, 운영성, 성능 | 실제 pipeline 변경에는 `ci-cd-and-automation`, UI/accessibility 작업에는 `frontend-ui-engineering`, telemetry에는 `observability-and-instrumentation`, 측정된 bottleneck에는 `performance-optimization`을 조건부 보완으로 사용한다. |
| 검증/통합 | 완료 주장 전 `verification-before-completion`. `finishing-a-development-branch`는 통합이 실제 범위일 때만 사용하며, 요청 없는 commit/push/정리를 하지 않는다. |
| 격리/병렬 읽기 | 실제 구현 경로가 필요할 때 기존/native 격리 수단을 먼저 확인하는 `using-git-worktrees`. 독립 읽기 트랙 병렬화는 허용된 경우에만 `dispatching-parallel-agents`; SDD 구현자를 별도로 병렬 중첩하지 않는다. |
`deep-interview`는 목표, 범위, 제약, 성공 기준, 맥락 중 중요한 미해결 사항이 있거나 해석이 충돌/핵심 조건이 빠졌거나 사용자가 명시한 경우에만 잠시 소유한다. 질문은 한 번에 하나씩 한다. 해당 점수법에서 전체 불확실성 0.20 이하뿐 아니라 모든 중요한 결정이 해결되어야 종료하며, 중요한 차원 하나라도 0.50 이하로 충분히 확정되지 않으면 계속한다. 해결된 문제를 반복 인터뷰하지 않는다. 이 스킬은 산출물/의존성을 정하지 않는다. 자동 `.scratch`나 별도 명세를 만들지 말고 요약을 기존 PRD에 반영한다.
`grilling`은 계획·결정·아이디어 전반에 대한 스트레스 테스트이며 아키텍처 전용이 아니다. 사용자가 원하거나 구체적인 아키텍처 대안을 비교할 때 주로 쓴다. 회차마다 의존 조건이 해결된 질문을 묶어 묻고 답변을 기다리며, 종료 시 사용자의 공유 이해 확인을 받는다. 그릴의 다중 질문 회차와 다른 스킬의 한 번에 하나 질문 규칙을 동시에 적용하지 않는다. `codebase-design`은 모듈 규모와 무관한 depth/seam/locality 및 exposed interface를 다루고, `api-and-interface-design`은 내부·외부 API 계약의 안정성/errors/compatibility를 다룬다. 두 skill을 internal/public로만 나누지 않는다. 둘 다 별도의 전체 설계나 인터뷰 절차를 대체하지 않는다.
### 자동 선택과 실행 경계
- Codex 스킬 자동 호출은 설치 정의의 `agents/openai.yaml` `policy.allow_implicit_invocation: false`로 막을 수 있다(기본값은 true). 명시적 호출은 별개다.
- OpenCode의 `metadata['opencode/autoinvoke']='false'`는 모델 자동 선택 노출을 숨기지만 직접 호출을 막지 않는다. `permission.skill`의 deny/ask와 agent/tool 권한은 별도 제어다. `disable-model-invocation`은 OpenCode의 문서화된 동등 설정이 아니다.
- `improve-codebase-architecture`와 `setup-matt-pocock-skills`는 `disable-model-invocation: true` 및 Codex implicit false가 있다. OpenCode autoinvoke metadata는 없어 광고될 수 있다. 프로젝트 정책상 명시 전용이지만 Markdown이 OpenCode backend/hook 차단을 강제하는 것은 아니다. “기존 코드 구조 개선 후보 찾기”나 일반 HTML 요청만으로 실행하지 않는다. 사용자가 skill 이름으로 명시 호출한 경우에만 그 workflow를 고려하며, 요청 범위를 넘어 HTML 생성/브라우저 열기/grilling을 흉내 내지 않는다. 허용된 읽기 전용 `codebase-design` 분석은 별개다. `setup-matt-pocock-skills`는 별도 일회성 명시 요청에만 쓴다.
- 빠진 스킬이나 필수 참고 파일이 있으면 한계를 알리고 가능한 부분 확인만 한다. 완전한 절차를 수행했다고 주장하지 않는다. 스킬 설치나 메타데이터 변경으로 제한을 우회하지 않는다. gstack은 어느 단계에서도 사용하거나 설치하지 않는다.
- 웹 대상 스킬의 예시는 적용 가능한 통제만 참고한다. iOS 코드에 서버 cookie/CSP 등을 옮겨 적용하지 않으며 SodaLive의 실제 API와 스타일을 따른다.
## 에이전트 동작 원칙
- 추측하지 말고 근거 파일을 읽고 결정한다.
@@ -140,7 +151,7 @@ Strong success criteria let you loop independently. Weak criteria ("make it work
- iOS 코드 스타일은 `docs/agent-guides/code-style.md`를 참조한다.
- Cursor/Copilot 규칙은 `docs/agent-guides/sodalive-ios-development.md`를 참조한다.
- 커밋 상세 가이드/절차는 `.opencode/skills/commit-policy/SKILL.md`를 단일 기준으로 사용한다.
- 커밋 작업 시작 시 `skill` 도구로 `commit-policy`를 먼저 로드한다.
- 커밋 작업 시작 시 `commit-policy`를 먼저 로드한다. OpenCode에서는 `skill` 도구를 사용하고, Codex에서는 발견된 `SKILL.md` 또는 `.opencode/skills/commit-policy/SKILL.md`를 읽는다.
- 기본 커밋 형식은 `<type>(scope): <description>`를 사용하고, 제목(description)은 한글 명령형/간결한 현재형으로 작성한다.
- `git commit` 직후 `work/scripts/check-commit-message-rules.sh`를 실행해 규칙 준수 여부를 확인한다.
@@ -160,3 +171,13 @@ Strong success criteria let you loop independently. Weak criteria ("make it work
## 문서 유지보수 규칙
- 상세 문서 유지보수 규칙은 `docs/agent-guides/documentation-policy.md`를 참조한다.
- `docs/sample/**`의 경로 또는 구조가 바뀌면 `AGENTS.md`, `docs/agent-guides/**`, 샘플 간 참조를 함께 갱신해 서로 일치시킨다.
## Agent skills
### Issue tracker
로컬 Markdown으로 `.scratch/<feature-slug>/`에서 이슈를 관리한다. 세부 규칙은 `docs/agents/issue-tracker.md`를 따른다.
### Domain docs
single-context 구조로 루트 `GLOSSARY.md`와 `docs/adr/`를 사용한다. 읽기 규칙은 `docs/agents/domain.md`를 따른다.
-2
View File
@@ -10,7 +10,6 @@ target 'SodaLive' do
pod 'AgoraRtm', '2.2.4'
pod 'GoogleSignIn'
pod 'GoogleSignInSwiftSupport'
pod 'YandexMobileAds', '8.0.0'
end
@@ -23,7 +22,6 @@ target 'SodaLive-dev' do
pod 'AgoraRtm', '2.2.4'
pod 'GoogleSignIn'
pod 'GoogleSignInSwiftSupport'
pod 'YandexMobileAds', '8.0.0'
end
+1 -157
View File
@@ -15,74 +15,6 @@ PODS:
- GoogleUtilities/Environment (~> 8.0)
- GoogleUtilities/UserDefaults (~> 8.0)
- PromisesObjC (~> 2.4)
- AppMetricaAdSupport (6.0.0):
- AppMetricaCore (= 6.0.0)
- AppMetricaCoreExtension (= 6.0.0)
- AppMetricaCore (6.0.0):
- AppMetricaCoreUtils (= 6.0.0)
- AppMetricaEncodingUtils (= 6.0.0)
- AppMetricaFMDB (= 6.0.0)
- AppMetricaHostState (= 6.0.0)
- AppMetricaIdentifiers (= 6.0.0)
- AppMetricaKeychain (= 6.0.0)
- AppMetricaLog (= 6.0.0)
- AppMetricaNetwork (= 6.0.0)
- AppMetricaPlatform (= 6.0.0)
- AppMetricaProtobuf (= 6.0.0)
- AppMetricaProtobufUtils (= 6.0.0)
- AppMetricaStorageUtils (= 6.0.0)
- AppMetricaCoreExtension (6.0.0):
- AppMetricaCore (= 6.0.0)
- AppMetricaStorageUtils (= 6.0.0)
- AppMetricaCoreUtils (6.0.0):
- AppMetricaLog (= 6.0.0)
- AppMetricaEncodingUtils (6.0.0):
- AppMetricaCoreUtils (= 6.0.0)
- AppMetricaLog (= 6.0.0)
- AppMetricaPlatform (= 6.0.0)
- AppMetricaFMDB (6.0.0)
- AppMetricaHostState (6.0.0):
- AppMetricaCoreUtils (= 6.0.0)
- AppMetricaLog (= 6.0.0)
- AppMetricaIdentifiers (6.0.0):
- AppMetricaKeychain (= 6.0.0)
- AppMetricaLogSwift (= 6.0.0)
- AppMetricaPlatform (= 6.0.0)
- AppMetricaStorageUtils (= 6.0.0)
- AppMetricaSynchronization (= 6.0.0)
- AppMetricaIDSync (6.0.0):
- AppMetricaCore (= 6.0.0)
- AppMetricaCoreExtension (= 6.0.0)
- AppMetricaCoreUtils (= 6.0.0)
- AppMetricaLog (= 6.0.0)
- AppMetricaNetwork (= 6.0.0)
- AppMetricaPlatform (= 6.0.0)
- AppMetricaStorageUtils (= 6.0.0)
- AppMetricaKeychain (6.0.0):
- AppMetricaCoreUtils (= 6.0.0)
- AppMetricaLog (= 6.0.0)
- AppMetricaStorageUtils (= 6.0.0)
- AppMetricaLibraryAdapter (6.0.0):
- AppMetricaCore (= 6.0.0)
- AppMetricaCoreExtension (= 6.0.0)
- AppMetricaLog (6.0.0)
- AppMetricaLogSwift (6.0.0):
- AppMetricaLog (= 6.0.0)
- AppMetricaNetwork (6.0.0):
- AppMetricaCoreUtils (= 6.0.0)
- AppMetricaLog (= 6.0.0)
- AppMetricaPlatform (= 6.0.0)
- AppMetricaPlatform (6.0.0):
- AppMetricaCoreUtils (= 6.0.0)
- AppMetricaLog (= 6.0.0)
- AppMetricaProtobuf (6.0.0)
- AppMetricaProtobufUtils (6.0.0):
- AppMetricaProtobuf (= 6.0.0)
- AppMetricaStorageUtils (6.0.0):
- AppMetricaCoreUtils (= 6.0.0)
- AppMetricaLog (= 6.0.0)
- AppMetricaSynchronization (6.0.0):
- AppMetricaLogSwift (= 6.0.0)
- Bootpay (4.4.6):
- CryptoSwift
- NVActivityIndicatorView
@@ -95,19 +27,6 @@ PODS:
- SnapKit
- SwiftyJSON
- CryptoSwift (1.8.4)
- DivKit (32.46.0):
- DivKit_LayoutKit (= 32.46.0)
- DivKit_Serialization (= 32.46.0)
- VGSL (~> 7.21)
- DivKit_LayoutKit (32.46.0):
- DivKit_LayoutKitInterface (= 32.46.0)
- VGSL (~> 7.21)
- DivKit_LayoutKitInterface (32.46.0):
- VGSL (~> 7.21)
- DivKit_Serialization (32.46.0):
- VGSL (~> 7.21)
- DivKitBinaryCompatibilityFacade (5.3.0):
- DivKit (~> 32.14)
- GoogleSignIn (9.1.0):
- AppAuth (~> 2.0)
- AppCheckCore (~> 11.0)
@@ -135,29 +54,12 @@ PODS:
- PromisesObjC (2.4.0)
- SnapKit (5.7.1)
- SwiftyJSON (5.0.2)
- VGSL (7.21.0):
- VGSLFundamentals (= 7.21.0)
- VGSLNetworking (= 7.21.0)
- VGSLUI (= 7.21.0)
- VGSLFundamentals (7.21.0)
- VGSLNetworking (7.21.0):
- VGSLFundamentals (= 7.21.0)
- VGSLUI (= 7.21.0)
- VGSLUI (7.21.0):
- VGSLFundamentals (= 7.21.0)
- YandexMobileAds (8.0.0):
- AppMetricaAdSupport (~> 6.0.0)
- AppMetricaCore (~> 6.0.0)
- AppMetricaIDSync (~> 6.0.0)
- AppMetricaLibraryAdapter (~> 6.0.0)
- DivKitBinaryCompatibilityFacade (~> 5.3.0)
DEPENDENCIES:
- AgoraRtm (= 2.2.4)
- BootpayUI (= 4.4.10)
- GoogleSignIn
- GoogleSignInSwiftSupport
- YandexMobileAds (= 8.0.0)
SPEC REPOS:
trunk:
@@ -165,33 +67,9 @@ SPEC REPOS:
- Alamofire
- AppAuth
- AppCheckCore
- AppMetricaAdSupport
- AppMetricaCore
- AppMetricaCoreExtension
- AppMetricaCoreUtils
- AppMetricaEncodingUtils
- AppMetricaFMDB
- AppMetricaHostState
- AppMetricaIdentifiers
- AppMetricaIDSync
- AppMetricaKeychain
- AppMetricaLibraryAdapter
- AppMetricaLog
- AppMetricaLogSwift
- AppMetricaNetwork
- AppMetricaPlatform
- AppMetricaProtobuf
- AppMetricaProtobufUtils
- AppMetricaStorageUtils
- AppMetricaSynchronization
- Bootpay
- BootpayUI
- CryptoSwift
- DivKit
- DivKit_LayoutKit
- DivKit_LayoutKitInterface
- DivKit_Serialization
- DivKitBinaryCompatibilityFacade
- GoogleSignIn
- GoogleSignInSwiftSupport
- GoogleUtilities
@@ -202,44 +80,15 @@ SPEC REPOS:
- PromisesObjC
- SnapKit
- SwiftyJSON
- VGSL
- VGSLFundamentals
- VGSLNetworking
- VGSLUI
- YandexMobileAds
SPEC CHECKSUMS:
AgoraRtm: 534144434383d41b3b0ebfae2a961ef0f51b0645
Alamofire: 7193b3b92c74a07f85569e1a6c4f4237291e7496
AppAuth: 1c1a8afa7e12f2ec3a294d9882dfa5ab7d3cb063
AppCheckCore: cc8fd0a3a230ddd401f326489c99990b013f0c4f
AppMetricaAdSupport: 43a4d1509cdbfe712fb3f009fe60d3a6481816a0
AppMetricaCore: dae62fe7f95cd665b142218f3d94cf63262c195b
AppMetricaCoreExtension: 72da13ba849d4676f276ab86ff429bdf700eadc3
AppMetricaCoreUtils: 5e7c91cbafe0225dec2ded2bb3a806256e2ef791
AppMetricaEncodingUtils: a67df57f752dbbb174beea18f1de52d24853d834
AppMetricaFMDB: a3d8e45a5a85bec23a997be4469b92ab355a4df5
AppMetricaHostState: 1ac2ab5880aa30a358f55a044e57354dd8f9062f
AppMetricaIdentifiers: 00061e0cdcb371b74343a5491f54adfc1d470b25
AppMetricaIDSync: 91b403172ad78da3574c691ed34c25f69c2296ee
AppMetricaKeychain: 9ec64d877b8a3f6e823f3bbeef5e4086aa456686
AppMetricaLibraryAdapter: 56fa0f988850051d10f9ac3b6b9ace7bb6aa8fd7
AppMetricaLog: edd74df81c7557439c36c566989982f4c735e4d6
AppMetricaLogSwift: 3d2d4a3cbc33a680389b416a1c6a82ef4134da10
AppMetricaNetwork: 3dc6d768d4e932c3697c9c2c9a768de54e62059b
AppMetricaPlatform: 041a7b251ea1689e26626d9db8f331af1afe5bad
AppMetricaProtobuf: 01b141a164fa7277f641a29f30d5e571ea3d471a
AppMetricaProtobufUtils: dc48c7b84f3a1ef86ea218bbd97480ea9da4d3bc
AppMetricaStorageUtils: 78071115b9f5468d9e3b8184c456428cd9ee1dbd
AppMetricaSynchronization: 909bab97c61c0c147a435ce1620e4c8069e2d6b3
Bootpay: cd7f0542b096ab0af0b09a6e12a6b87f2cbbb531
BootpayUI: beec5b0bba002b4dbced8c0ecace571ed6a017bc
CryptoSwift: e64e11850ede528a02a0f3e768cec8e9d92ecb90
DivKit: c66e0fa88b4671f832fb9ca3f142d6f56a56919d
DivKit_LayoutKit: e30d4d345034c2dfb356e5a891dd359ac79a5aff
DivKit_LayoutKitInterface: 320f0ef8c4f95bb8212b13400502adf0259c0b21
DivKit_Serialization: c5ba4f12034eca16960e80f369b689fd8cda95b0
DivKitBinaryCompatibilityFacade: fc2284a2edea4d65aa0966006ea63274eb9f721b
GoogleSignIn: fcee2257188d5eda57a5e2b6a715550ffff9206d
GoogleSignInSwiftSupport: aca902e4e15b234611ecac74ef5c8f61278f774e
GoogleUtilities: 00c88b9a86066ef77f0da2fab05f65d7768ed8e1
@@ -250,12 +99,7 @@ SPEC CHECKSUMS:
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
SnapKit: d612e99e678a2d3b95bf60b0705ed0a35c03484a
SwiftyJSON: f5b1bf1cd8dd53cd25887ac0eabcfd92301c6a5a
VGSL: 0573c2b82b05aadcba4836398ce3778d271bfd13
VGSLFundamentals: 3a081684c1a5df5800bf88aca8a9bdff2c10cfd9
VGSLNetworking: 0ea8a335bc4f4eba3f6123ffe441cf1c08f267f2
VGSLUI: 249a16cccdb75f1a5a1733894d013bca76e27c5e
YandexMobileAds: ca6c63c4148ae87fefc1821d0b466ea567069d5b
PODFILE CHECKSUM: 525ba559e93875de1314bb1a7894791eee442151
PODFILE CHECKSUM: 70c5639090824ff26cfad959985347579609e1e6
COCOAPODS: 1.16.2
+431 -57
View File
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 70;
objectVersion = 77;
objects = {
/* Begin PBXBuildFile section */
@@ -1626,6 +1626,34 @@
6A28B7059D970EC4E882EEA1 /* CreatorChannelFanTalkListItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = D354C827944EC15C7D0FFBE0 /* CreatorChannelFanTalkListItem.swift */; };
6B7A9ED264B5909F2E9F6E1C /* MainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72CD656CAEE376701F2B563E /* MainView.swift */; };
6CDDA1EEA4D2E47A563FD687 /* CreatorChannelFanTalkListItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = D354C827944EC15C7D0FFBE0 /* CreatorChannelFanTalkListItem.swift */; };
6F7110010000000000000001 /* GiftModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F7100010000000000000001 /* GiftModels.swift */; };
6F7110010000000000000002 /* GiftApi.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F7100010000000000000002 /* GiftApi.swift */; };
6F7110010000000000000003 /* GiftRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F7100010000000000000003 /* GiftRepository.swift */; };
6F7110010000000000000004 /* GiftDisplayModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F7100010000000000000004 /* GiftDisplayModels.swift */; };
6F7110010000000000000005 /* GiftDisplayPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F7100010000000000000005 /* GiftDisplayPolicy.swift */; };
6F7110010000000000000006 /* GiftConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F7100010000000000000006 /* GiftConstants.swift */; };
6F7110010000000000000007 /* GiftSendView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F7100010000000000000007 /* GiftSendView.swift */; };
6F7110010000000000000008 /* GiftBoxListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F7100010000000000000008 /* GiftBoxListView.swift */; };
6F7110010000000000000009 /* GiftDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F7100010000000000000009 /* GiftDetailView.swift */; };
6F711001000000000000000A /* GiftTrackingRegistrationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F710001000000000000000A /* GiftTrackingRegistrationView.swift */; };
6F711001000000000000000C /* GiftSendViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F710001000000000000000C /* GiftSendViewModel.swift */; };
6F711001000000000000000D /* GiftSendBannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F710001000000000000000D /* GiftSendBannerView.swift */; };
6F711001000000000000000E /* GiftSenderFormView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F710001000000000000000E /* GiftSenderFormView.swift */; };
6F711001000000000000000F /* GiftAgreementRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F710001000000000000000F /* GiftAgreementRow.swift */; };
6F7130010000000000000001 /* GiftModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F7100010000000000000001 /* GiftModels.swift */; };
6F7130010000000000000002 /* GiftApi.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F7100010000000000000002 /* GiftApi.swift */; };
6F7130010000000000000003 /* GiftRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F7100010000000000000003 /* GiftRepository.swift */; };
6F7130010000000000000004 /* GiftDisplayModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F7100010000000000000004 /* GiftDisplayModels.swift */; };
6F7130010000000000000005 /* GiftDisplayPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F7100010000000000000005 /* GiftDisplayPolicy.swift */; };
6F7130010000000000000006 /* GiftConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F7100010000000000000006 /* GiftConstants.swift */; };
6F7130010000000000000007 /* GiftSendView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F7100010000000000000007 /* GiftSendView.swift */; };
6F7130010000000000000008 /* GiftBoxListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F7100010000000000000008 /* GiftBoxListView.swift */; };
6F7130010000000000000009 /* GiftDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F7100010000000000000009 /* GiftDetailView.swift */; };
6F713001000000000000000A /* GiftTrackingRegistrationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F710001000000000000000A /* GiftTrackingRegistrationView.swift */; };
6F713001000000000000000C /* GiftSendViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F710001000000000000000C /* GiftSendViewModel.swift */; };
6F713001000000000000000D /* GiftSendBannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F710001000000000000000D /* GiftSendBannerView.swift */; };
6F713001000000000000000E /* GiftSenderFormView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F710001000000000000000E /* GiftSenderFormView.swift */; };
6F713001000000000000000F /* GiftAgreementRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F710001000000000000000F /* GiftAgreementRow.swift */; };
6FF4EB9BF0C754D1C31B347F /* V2vState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4339CA77E17ECD66D39D6379 /* V2vState.swift */; };
70E2CE7366BDBAC59BB39B41 /* AppDeepLinkHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54CF63CA56D78A23F93C21E5 /* AppDeepLinkHandler.swift */; };
723D2E30F7D7B0F6711EA589 /* GetPushNotificationListResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = F23D0834690CFE9FBDC10510 /* GetPushNotificationListResponse.swift */; };
@@ -1645,7 +1673,6 @@
843C3C5366C9D9DEE37878BF /* ChannelDonationItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A7650B281CE20A6F29F6253 /* ChannelDonationItemView.swift */; };
85934EA071477BC71BFCDF5E /* Pods_SodaLive.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 19E2FD56B42EBD353B9D2016 /* Pods_SodaLive.framework */; };
895286621DBE8EC8C825A9B5 /* GetPushNotificationCategoryResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = B54EBFBCC66E5AC79197E1FC /* GetPushNotificationCategoryResponse.swift */; };
89AF41E6A46CD84BA469F272 /* YandexAdSupport.swift in Sources */ = {isa = PBXBuildFile; fileRef = F064EC9D5711B91979F45C05 /* YandexAdSupport.swift */; };
89BA3654EB2D35AC48F99472 /* LanguageService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7132AA3D131A8DF7B8D783BE /* LanguageService.swift */; };
8A3E98E8F5E3862EAED3B5F9 /* FontModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 25D89184D67BD63E46E90281 /* FontModifier.swift */; };
8D359DA75B6E24D9FF0A0865 /* V2vModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C4AF495E30F2DB00C2FCB36 /* V2vModels.swift */; };
@@ -1677,6 +1704,14 @@
A4F100000000000000000003 /* LottieRefreshableScrollView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4F100000000000000000006 /* LottieRefreshableScrollView.swift */; };
A4F100000000000000000004 /* LottieRefreshableScrollView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4F100000000000000000006 /* LottieRefreshableScrollView.swift */; };
A840136779D6CC95F94CB681 /* HomeTitleBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAA81E8424A575A0F8546D31 /* HomeTitleBar.swift */; };
AC5100013012000000A5BBA3 /* AuthContentSettingsSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC5100003012000000A5BBA3 /* AuthContentSettingsSheet.swift */; };
AC5100023012000000A5BBA3 /* AuthContentSettingsSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC5100003012000000A5BBA3 /* AuthContentSettingsSheet.swift */; };
AC5200013012000000A5BBA3 /* AuthVerificationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC5200003012000000A5BBA3 /* AuthVerificationView.swift */; };
AC5200023012000000A5BBA3 /* AuthVerificationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC5200003012000000A5BBA3 /* AuthVerificationView.swift */; };
AC5200043012000000A5BBA3 /* AuthVerificationMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC5200033012000000A5BBA3 /* AuthVerificationMock.swift */; };
AC5200053012000000A5BBA3 /* AuthVerificationMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC5200033012000000A5BBA3 /* AuthVerificationMock.swift */; };
AC5280013010280000A5BBA3 /* MyPageNoticeRoller.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC5280033010280000A5BBA3 /* MyPageNoticeRoller.swift */; };
AC5280023010280000A5BBA3 /* MyPageNoticeRoller.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC5280033010280000A5BBA3 /* MyPageNoticeRoller.swift */; };
ACD71056E97E13E48941ABBB /* MainPlaceholderTabView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7900EA9FD1150BABE64CF1B3 /* MainPlaceholderTabView.swift */; };
AD6424211AA898794BBE8470 /* SectionTitle.swift in Sources */ = {isa = PBXBuildFile; fileRef = D16C12DFB83FE164B38CC066 /* SectionTitle.swift */; };
AEFFD4DC842837ACF98BE697 /* PostChannelDonationRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BBDC3ECBBE049EAA4057D3A /* PostChannelDonationRequest.swift */; };
@@ -1687,6 +1722,12 @@
B11681AC02BF51C6E2FA6FF3 /* MainTabBarButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8F49E8BB9BACFCA8878B70D /* MainTabBarButton.swift */; };
B3AF650899B8FC84E0C0CDA0 /* MainPlaceholderTabView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7900EA9FD1150BABE64CF1B3 /* MainPlaceholderTabView.swift */; };
B5E9FA82CF4238F640702D4A /* CreatorDetailDialogView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7406AE69F7667FAA2E6DD23 /* CreatorDetailDialogView.swift */; };
BA2910013010000000A5BBA3 /* SubBanner.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA2900013010000000A5BBA3 /* SubBanner.swift */; };
BA2910023010000000A5BBA3 /* SubBannerLinkOpener.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA2900023010000000A5BBA3 /* SubBannerLinkOpener.swift */; };
BA2910033010000000A5BBA3 /* SubBannerCarousel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA2900033010000000A5BBA3 /* SubBannerCarousel.swift */; };
BA2920013010000000A5BBA3 /* SubBanner.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA2900013010000000A5BBA3 /* SubBanner.swift */; };
BA2920023010000000A5BBA3 /* SubBannerLinkOpener.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA2900023010000000A5BBA3 /* SubBannerLinkOpener.swift */; };
BA2920033010000000A5BBA3 /* SubBannerCarousel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA2900033010000000A5BBA3 /* SubBannerCarousel.swift */; };
BA511503C1E037162697D771 /* DonationRankingPeriod.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44A42B63A1021DD9F8AA3F30 /* DonationRankingPeriod.swift */; };
BCA6CD9E57528C5F4203F1A5 /* CapsuleTabBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74990A0798E64A97237DD113 /* CapsuleTabBar.swift */; };
BEAAA523CAD3198065A557BC /* EntityInfo-SodaLive-dev.generated.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0ED95AC08C6481751AE9D97 /* EntityInfo-SodaLive-dev.generated.swift */; };
@@ -1820,6 +1861,8 @@
C0A74100000000000000000F /* UserCreatorChatRoomViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0A74000000000000000000F /* UserCreatorChatRoomViewModel.swift */; };
C0A741000000000000000010 /* UserCreatorChatRoomView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0A740000000000000000010 /* UserCreatorChatRoomView.swift */; };
C0A741000000000000000011 /* UserCreatorChatSessionNotification.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0A740000000000000000011 /* UserCreatorChatSessionNotification.swift */; };
C0A741000000000000000012 /* UserCreatorChatDatePresentation.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0A740000000000000000012 /* UserCreatorChatDatePresentation.swift */; };
C0A741000000000000000013 /* UserCreatorChatDateSeparatorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0A740000000000000000013 /* UserCreatorChatDateSeparatorView.swift */; };
C0A742000000000000000001 /* MainChatRoomsResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0A740000000000000000001 /* MainChatRoomsResponse.swift */; };
C0A742000000000000000002 /* MainChatApi.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0A740000000000000000002 /* MainChatApi.swift */; };
C0A742000000000000000003 /* MainChatRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0A740000000000000000003 /* MainChatRepository.swift */; };
@@ -1844,11 +1887,50 @@
C0A74300000000000000000F /* UserCreatorChatRoomViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0A74000000000000000000F /* UserCreatorChatRoomViewModel.swift */; };
C0A743000000000000000010 /* UserCreatorChatRoomView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0A740000000000000000010 /* UserCreatorChatRoomView.swift */; };
C0A743000000000000000011 /* UserCreatorChatSessionNotification.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0A740000000000000000011 /* UserCreatorChatSessionNotification.swift */; };
C0A743000000000000000012 /* UserCreatorChatDatePresentation.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0A740000000000000000012 /* UserCreatorChatDatePresentation.swift */; };
C0A743000000000000000013 /* UserCreatorChatDateSeparatorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0A740000000000000000013 /* UserCreatorChatDateSeparatorView.swift */; };
C0D6E325AEFEEF476E7044AB /* CommunityPostCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE82912F2F111593BE42E33C /* CommunityPostCard.swift */; };
C3CFF5936F1BAC5BC12E9DDB /* UpdateContentPreferenceRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CDFAA64C2CA4FCBBF00A024 /* UpdateContentPreferenceRequest.swift */; };
C45F071870A4DB48ABAE8BC5 /* YandexAdSupport.swift in Sources */ = {isa = PBXBuildFile; fileRef = F064EC9D5711B91979F45C05 /* YandexAdSupport.swift */; };
C4A7064704896D68ACBA135F /* PushNotificationListItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FA7A276BF4A47206ED702A7 /* PushNotificationListItemView.swift */; };
C74811010000000000000001 /* GiftBoxListViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C74810010000000000000001 /* GiftBoxListViewModel.swift */; };
C74811010000000000000002 /* GiftBoxCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C74810010000000000000002 /* GiftBoxCardView.swift */; };
C74811010000000000000003 /* GiftBoxInfoBannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C74810010000000000000005 /* GiftBoxInfoBannerView.swift */; };
C74811010000000000000004 /* GiftBoxEmptyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C74810010000000000000004 /* GiftBoxEmptyView.swift */; };
C74813010000000000000001 /* GiftBoxListViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C74810010000000000000001 /* GiftBoxListViewModel.swift */; };
C74813010000000000000002 /* GiftBoxCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C74810010000000000000002 /* GiftBoxCardView.swift */; };
C74813010000000000000003 /* GiftBoxInfoBannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C74810010000000000000005 /* GiftBoxInfoBannerView.swift */; };
C74813010000000000000004 /* GiftBoxEmptyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C74810010000000000000004 /* GiftBoxEmptyView.swift */; };
C75111010000000000000001 /* GiftDetailViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C75110010000000000000001 /* GiftDetailViewModel.swift */; };
C75113010000000000000001 /* GiftDetailViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C75110010000000000000001 /* GiftDetailViewModel.swift */; };
C75211010000000000000001 /* GiftProgressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C75210010000000000000001 /* GiftProgressView.swift */; };
C75211010000000000000002 /* GiftInfoSectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C75210010000000000000002 /* GiftInfoSectionView.swift */; };
C75213010000000000000001 /* GiftProgressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C75210010000000000000001 /* GiftProgressView.swift */; };
C75213010000000000000002 /* GiftInfoSectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C75210010000000000000002 /* GiftInfoSectionView.swift */; };
C75311010000000000000001 /* SentGiftDetailContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C75310010000000000000001 /* SentGiftDetailContentView.swift */; };
C75313010000000000000001 /* SentGiftDetailContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C75310010000000000000001 /* SentGiftDetailContentView.swift */; };
C75411010000000000000001 /* GiftDetailActionBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = C75410010000000000000001 /* GiftDetailActionBar.swift */; };
C75413010000000000000001 /* GiftDetailActionBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = C75410010000000000000001 /* GiftDetailActionBar.swift */; };
C75511010000000000000001 /* GiftCancelCompleteView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C75510010000000000000001 /* GiftCancelCompleteView.swift */; };
C75513010000000000000001 /* GiftCancelCompleteView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C75510010000000000000001 /* GiftCancelCompleteView.swift */; };
C75E4F62AFB669F455449687 /* GetPushNotificationListResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = F23D0834690CFE9FBDC10510 /* GetPushNotificationListResponse.swift */; };
C76111010000000000000001 /* GiftTrackingRegistrationViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C76110010000000000000001 /* GiftTrackingRegistrationViewModel.swift */; };
C76113010000000000000001 /* GiftTrackingRegistrationViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C76110010000000000000001 /* GiftTrackingRegistrationViewModel.swift */; };
C76211010000000000000001 /* GiftCourierPickerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C76210010000000000000001 /* GiftCourierPickerView.swift */; };
C76213010000000000000001 /* GiftCourierPickerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C76210010000000000000001 /* GiftCourierPickerView.swift */; };
C77111010000000000000001 /* ReceivedGiftDetailContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C77110010000000000000001 /* ReceivedGiftDetailContentView.swift */; };
C77113010000000000000001 /* ReceivedGiftDetailContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C77110010000000000000001 /* ReceivedGiftDetailContentView.swift */; };
C77211010000000000000001 /* GiftRecipientAddressFormView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C77210010000000000000001 /* GiftRecipientAddressFormView.swift */; };
C77211010000000000000002 /* GiftRecipientAddressViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C77210010000000000000002 /* GiftRecipientAddressViewModel.swift */; };
C77213010000000000000001 /* GiftRecipientAddressFormView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C77210010000000000000001 /* GiftRecipientAddressFormView.swift */; };
C77213010000000000000002 /* GiftRecipientAddressViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C77210010000000000000002 /* GiftRecipientAddressViewModel.swift */; };
C77911010000000000000001 /* KakaoPostcodeSearchView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C77910010000000000000001 /* KakaoPostcodeSearchView.swift */; };
C77911010000000000000002 /* SodaAddressInputView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C77910010000000000000002 /* SodaAddressInputView.swift */; };
C77913010000000000000001 /* KakaoPostcodeSearchView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C77910010000000000000001 /* KakaoPostcodeSearchView.swift */; };
C77913010000000000000002 /* SodaAddressInputView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C77910010000000000000002 /* SodaAddressInputView.swift */; };
C78011010000000000000001 /* GiftContactInputRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = C78010010000000000000001 /* GiftContactInputRule.swift */; };
C78011010000000000000002 /* GiftContactTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = C78010010000000000000002 /* GiftContactTextField.swift */; };
C78013010000000000000001 /* GiftContactInputRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = C78010010000000000000001 /* GiftContactInputRule.swift */; };
C78013010000000000000002 /* GiftContactTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = C78010010000000000000002 /* GiftContactTextField.swift */; };
C78714671E92BE39D476E121 /* V2vState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4339CA77E17ECD66D39D6379 /* V2vState.swift */; };
C8B170409F057CA2B8501362 /* KakaoSDKUser in Frameworks */ = {isa = PBXBuildFile; productRef = 927A707B5035B0A77C0F5EA6 /* KakaoSDKUser */; };
C922F89B79C84E542AD7DE4F /* V2ExpandableTextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C922F89A79C84E542AD7DE4F /* V2ExpandableTextView.swift */; };
@@ -2122,6 +2204,8 @@
E2C133B589E2DA7596B3BAEF /* ChannelDonationAllView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 872F4F3506F36E0EAAE312ED /* ChannelDonationAllView.swift */; };
E316EBA3E7125AFDA6CBE68D /* MainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72CD656CAEE376701F2B563E /* MainView.swift */; };
E71A5D3008A7706B4F425CA6 /* DefaultTitleBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7F1421DBAB56E2F6891625E /* DefaultTitleBar.swift */; };
ED2911010000000000000001 /* EventDetailViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED2910010000000000000001 /* EventDetailViewModel.swift */; };
ED2913010000000000000001 /* EventDetailViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED2910010000000000000001 /* EventDetailViewModel.swift */; };
F0F1F71CCA586A0CF5194FAB /* ChannelDonationItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A7650B281CE20A6F29F6253 /* ChannelDonationItemView.swift */; };
F357D803F7BEC1DBF3F76493 /* PushNotificationListItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FA7A276BF4A47206ED702A7 /* PushNotificationListItemView.swift */; };
F6DA2AAF5186543C8486A3F9 /* UserProfileChannelDonationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 214C32BF44DF384FD6925E0B /* UserProfileChannelDonationView.swift */; };
@@ -2930,6 +3014,20 @@
6C076E80A2C92FEFFA5AB752 /* AcceptLanguagePlugin.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AcceptLanguagePlugin.swift; sourceTree = "<group>"; };
6DC033E531A9420363D017CE /* FollowButtonImageAsset.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FollowButtonImageAsset.swift; sourceTree = "<group>"; };
6F4E5BB7961B7E6BB68C3379 /* Pods_SodaLive_dev.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SodaLive_dev.framework; sourceTree = BUILT_PRODUCTS_DIR; };
6F7100010000000000000001 /* GiftModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiftModels.swift; sourceTree = "<group>"; };
6F7100010000000000000002 /* GiftApi.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiftApi.swift; sourceTree = "<group>"; };
6F7100010000000000000003 /* GiftRepository.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiftRepository.swift; sourceTree = "<group>"; };
6F7100010000000000000004 /* GiftDisplayModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiftDisplayModels.swift; sourceTree = "<group>"; };
6F7100010000000000000005 /* GiftDisplayPolicy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiftDisplayPolicy.swift; sourceTree = "<group>"; };
6F7100010000000000000006 /* GiftConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiftConstants.swift; sourceTree = "<group>"; };
6F7100010000000000000007 /* GiftSendView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiftSendView.swift; sourceTree = "<group>"; };
6F7100010000000000000008 /* GiftBoxListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiftBoxListView.swift; sourceTree = "<group>"; };
6F7100010000000000000009 /* GiftDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiftDetailView.swift; sourceTree = "<group>"; };
6F710001000000000000000A /* GiftTrackingRegistrationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiftTrackingRegistrationView.swift; sourceTree = "<group>"; };
6F710001000000000000000C /* GiftSendViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiftSendViewModel.swift; sourceTree = "<group>"; };
6F710001000000000000000D /* GiftSendBannerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiftSendBannerView.swift; sourceTree = "<group>"; };
6F710001000000000000000E /* GiftSenderFormView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiftSenderFormView.swift; sourceTree = "<group>"; };
6F710001000000000000000F /* GiftAgreementRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiftAgreementRow.swift; sourceTree = "<group>"; };
7132AA3D131A8DF7B8D783BE /* LanguageService.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = LanguageService.swift; sourceTree = "<group>"; };
716260E8214A329EE07CAAFA /* LanguageSettingsViewModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = LanguageSettingsViewModel.swift; sourceTree = "<group>"; };
72CD656CAEE376701F2B563E /* MainView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MainView.swift; sourceTree = "<group>"; };
@@ -2950,11 +3048,18 @@
A4F100000000000000000006 /* LottieRefreshableScrollView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LottieRefreshableScrollView.swift; sourceTree = "<group>"; };
A575789542808C0C87AC6D82 /* AiCharacterCard.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AiCharacterCard.swift; sourceTree = "<group>"; };
AB63E7E31B75FF2E6F1C9073 /* LanguageSettingsView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = LanguageSettingsView.swift; sourceTree = "<group>"; };
AC5100003012000000A5BBA3 /* AuthContentSettingsSheet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AuthContentSettingsSheet.swift; sourceTree = "<group>"; };
AC5200003012000000A5BBA3 /* AuthVerificationView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AuthVerificationView.swift; sourceTree = "<group>"; };
AC5200033012000000A5BBA3 /* AuthVerificationMock.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AuthVerificationMock.swift; sourceTree = "<group>"; };
AC5280033010280000A5BBA3 /* MyPageNoticeRoller.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyPageNoticeRoller.swift; sourceTree = "<group>"; };
B108032F3DC7110CBFD04130 /* Pods-SodaLive-dev.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SodaLive-dev.release.xcconfig"; path = "Target Support Files/Pods-SodaLive-dev/Pods-SodaLive-dev.release.xcconfig"; sourceTree = "<group>"; };
B54EBFBCC66E5AC79197E1FC /* GetPushNotificationCategoryResponse.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = GetPushNotificationCategoryResponse.swift; sourceTree = "<group>"; };
B7406AE69F7667FAA2E6DD23 /* CreatorDetailDialogView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CreatorDetailDialogView.swift; sourceTree = "<group>"; };
B7C4F8D708958D3E58AB9A77 /* LanguageOption.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = LanguageOption.swift; sourceTree = "<group>"; };
B8F49E8BB9BACFCA8878B70D /* MainTabBarButton.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MainTabBarButton.swift; sourceTree = "<group>"; };
BA2900013010000000A5BBA3 /* SubBanner.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubBanner.swift; sourceTree = "<group>"; };
BA2900023010000000A5BBA3 /* SubBannerLinkOpener.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubBannerLinkOpener.swift; sourceTree = "<group>"; };
BA2900033010000000A5BBA3 /* SubBannerCarousel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubBannerCarousel.swift; sourceTree = "<group>"; };
C07CBA176DB8BFF3F8D6BCEE /* TitleBar.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = TitleBar.swift; sourceTree = "<group>"; };
C0A700000000000000000001 /* MainContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainContentView.swift; sourceTree = "<group>"; };
C0A700000000000000000002 /* MainContentTab.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainContentTab.swift; sourceTree = "<group>"; };
@@ -3010,9 +3115,30 @@
C0A74000000000000000000F /* UserCreatorChatRoomViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserCreatorChatRoomViewModel.swift; sourceTree = "<group>"; };
C0A740000000000000000010 /* UserCreatorChatRoomView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserCreatorChatRoomView.swift; sourceTree = "<group>"; };
C0A740000000000000000011 /* UserCreatorChatSessionNotification.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserCreatorChatSessionNotification.swift; sourceTree = "<group>"; };
C0A740000000000000000012 /* UserCreatorChatDatePresentation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserCreatorChatDatePresentation.swift; sourceTree = "<group>"; };
C0A740000000000000000013 /* UserCreatorChatDateSeparatorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserCreatorChatDateSeparatorView.swift; sourceTree = "<group>"; };
C1165E3F4CA1AB019FC85067 /* LanguageRepository.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = LanguageRepository.swift; sourceTree = "<group>"; };
C40163E3E9DB325EA984D3C4 /* CreatorChannelFloatingIconButton.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CreatorChannelFloatingIconButton.swift; sourceTree = "<group>"; };
C6B18C00DE256DCC53030630 /* Spacing.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Spacing.swift; sourceTree = "<group>"; };
C74810010000000000000001 /* GiftBoxListViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiftBoxListViewModel.swift; sourceTree = "<group>"; };
C74810010000000000000002 /* GiftBoxCardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiftBoxCardView.swift; sourceTree = "<group>"; };
C74810010000000000000004 /* GiftBoxEmptyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiftBoxEmptyView.swift; sourceTree = "<group>"; };
C74810010000000000000005 /* GiftBoxInfoBannerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiftBoxInfoBannerView.swift; sourceTree = "<group>"; };
C75110010000000000000001 /* GiftDetailViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiftDetailViewModel.swift; sourceTree = "<group>"; };
C75210010000000000000001 /* GiftProgressView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiftProgressView.swift; sourceTree = "<group>"; };
C75210010000000000000002 /* GiftInfoSectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiftInfoSectionView.swift; sourceTree = "<group>"; };
C75310010000000000000001 /* SentGiftDetailContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentGiftDetailContentView.swift; sourceTree = "<group>"; };
C75410010000000000000001 /* GiftDetailActionBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiftDetailActionBar.swift; sourceTree = "<group>"; };
C75510010000000000000001 /* GiftCancelCompleteView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiftCancelCompleteView.swift; sourceTree = "<group>"; };
C76110010000000000000001 /* GiftTrackingRegistrationViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiftTrackingRegistrationViewModel.swift; sourceTree = "<group>"; };
C76210010000000000000001 /* GiftCourierPickerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiftCourierPickerView.swift; sourceTree = "<group>"; };
C77110010000000000000001 /* ReceivedGiftDetailContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReceivedGiftDetailContentView.swift; sourceTree = "<group>"; };
C77210010000000000000001 /* GiftRecipientAddressFormView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiftRecipientAddressFormView.swift; sourceTree = "<group>"; };
C77210010000000000000002 /* GiftRecipientAddressViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiftRecipientAddressViewModel.swift; sourceTree = "<group>"; };
C77910010000000000000001 /* KakaoPostcodeSearchView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KakaoPostcodeSearchView.swift; sourceTree = "<group>"; };
C77910010000000000000002 /* SodaAddressInputView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SodaAddressInputView.swift; sourceTree = "<group>"; };
C78010010000000000000001 /* GiftContactInputRule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiftContactInputRule.swift; sourceTree = "<group>"; };
C78010010000000000000002 /* GiftContactTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GiftContactTextField.swift; sourceTree = "<group>"; };
C922F89A79C84E542AD7DE4F /* V2ExpandableTextView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = V2ExpandableTextView.swift; sourceTree = "<group>"; };
CC0100012FF0100000A5BBA3 /* CreatorChannelHomeResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreatorChannelHomeResponse.swift; sourceTree = "<group>"; };
CC0100032FF0100000A5BBA3 /* CreatorChannelHomeApi.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreatorChannelHomeApi.swift; sourceTree = "<group>"; };
@@ -3111,9 +3237,9 @@
E56C8151F551B091940F16C4 /* V2vRepository.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = V2vRepository.swift; sourceTree = "<group>"; };
E61608194B084224DB6B78B5 /* TextTabBar.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = TextTabBar.swift; sourceTree = "<group>"; };
E92246F5C1254CBED72AD9AD /* AudioContentCard.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AudioContentCard.swift; sourceTree = "<group>"; };
ED2910010000000000000001 /* EventDetailViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventDetailViewModel.swift; sourceTree = "<group>"; };
EDB71B1A61924B10599005FE /* CreatorChannelFanTalkCountBar.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CreatorChannelFanTalkCountBar.swift; sourceTree = "<group>"; };
EF47BCA4DC51200D63D1E2D7 /* CreatorChannelFanTalkRepository.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CreatorChannelFanTalkRepository.swift; sourceTree = "<group>"; };
F064EC9D5711B91979F45C05 /* YandexAdSupport.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = YandexAdSupport.swift; sourceTree = "<group>"; };
F23D0834690CFE9FBDC10510 /* GetPushNotificationListResponse.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = GetPushNotificationListResponse.swift; sourceTree = "<group>"; };
F26CB443DA0ED4C45A18B258 /* PushNotificationApi.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PushNotificationApi.swift; sourceTree = "<group>"; };
F6966E927CDB1DE31F936757 /* CreatorProfileGrid.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CreatorProfileGrid.swift; sourceTree = "<group>"; };
@@ -3121,7 +3247,11 @@
/* End PBXFileReference section */
/* Begin PBXFileSystemSynchronizedRootGroup section */
401A3B942FEE61E000A5BBA3 /* docs */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = docs; sourceTree = "<group>"; };
401A3B942FEE61E000A5BBA3 /* docs */ = {
isa = PBXFileSystemSynchronizedRootGroup;
path = docs;
sourceTree = "<group>";
};
/* End PBXFileSystemSynchronizedRootGroup section */
/* Begin PBXFrameworksBuildPhase section */
@@ -3256,6 +3386,8 @@
25C5D0734F54C0ED7B7BD462 /* Modal */ = {
isa = PBXGroup;
children = (
AC5200003012000000A5BBA3 /* AuthVerificationView.swift */,
AC5100003012000000A5BBA3 /* AuthContentSettingsSheet.swift */,
25C5D0714F54C0ED7B7BD462 /* SodaV2ActionModal.swift */,
);
path = Modal;
@@ -3265,6 +3397,9 @@
isa = PBXGroup;
children = (
24266E32FC49D7C31610C2AD /* BannerCarousel.swift */,
BA2900013010000000A5BBA3 /* SubBanner.swift */,
BA2900023010000000A5BBA3 /* SubBannerLinkOpener.swift */,
BA2900033010000000A5BBA3 /* SubBannerCarousel.swift */,
);
path = Banner;
sourceTree = "<group>";
@@ -4578,7 +4713,6 @@
4091446A2A86228E00EEBFB1 /* ActivityViewController.swift */,
375C41DF9D62AF5B9C3C1FAC /* DateParser.swift */,
6DC033E531A9420363D017CE /* FollowButtonImageAsset.swift */,
F064EC9D5711B91979F45C05 /* YandexAdSupport.swift */,
);
path = Common;
sourceTree = "<group>";
@@ -5598,6 +5732,108 @@
path = Repository;
sourceTree = "<group>";
};
6F7100010000000000000011 /* Models */ = {
isa = PBXGroup;
children = (
6F7100010000000000000001 /* GiftModels.swift */,
6F7100010000000000000004 /* GiftDisplayModels.swift */,
6F7100010000000000000005 /* GiftDisplayPolicy.swift */,
);
path = Models;
sourceTree = "<group>";
};
6F7100010000000000000012 /* Repository */ = {
isa = PBXGroup;
children = (
6F7100010000000000000002 /* GiftApi.swift */,
6F7100010000000000000003 /* GiftRepository.swift */,
);
path = Repository;
sourceTree = "<group>";
};
6F7100010000000000000013 /* Gift */ = {
isa = PBXGroup;
children = (
6F7100010000000000000011 /* Models */,
6F7100010000000000000012 /* Repository */,
6F7100010000000000000014 /* Constants */,
6F710001000000000000001A /* Components */,
6F7100010000000000000015 /* Send */,
6F7100010000000000000016 /* List */,
6F7100010000000000000017 /* Detail */,
6F7100010000000000000018 /* Tracking */,
C77210010000000000000003 /* RecipientAddress */,
);
path = Gift;
sourceTree = "<group>";
};
6F7100010000000000000014 /* Constants */ = {
isa = PBXGroup;
children = (
6F7100010000000000000006 /* GiftConstants.swift */,
);
path = Constants;
sourceTree = "<group>";
};
6F7100010000000000000015 /* Send */ = {
isa = PBXGroup;
children = (
6F7100010000000000000007 /* GiftSendView.swift */,
6F710001000000000000000C /* GiftSendViewModel.swift */,
6F7100010000000000000019 /* Components */,
);
path = Send;
sourceTree = "<group>";
};
6F7100010000000000000016 /* List */ = {
isa = PBXGroup;
children = (
6F7100010000000000000008 /* GiftBoxListView.swift */,
C74810010000000000000001 /* GiftBoxListViewModel.swift */,
C74810010000000000000003 /* Components */,
);
path = List;
sourceTree = "<group>";
};
6F7100010000000000000017 /* Detail */ = {
isa = PBXGroup;
children = (
6F7100010000000000000009 /* GiftDetailView.swift */,
C75110010000000000000001 /* GiftDetailViewModel.swift */,
C75210010000000000000003 /* Components */,
);
path = Detail;
sourceTree = "<group>";
};
6F7100010000000000000018 /* Tracking */ = {
isa = PBXGroup;
children = (
6F710001000000000000000A /* GiftTrackingRegistrationView.swift */,
C76110010000000000000001 /* GiftTrackingRegistrationViewModel.swift */,
C76210010000000000000002 /* Components */,
);
path = Tracking;
sourceTree = "<group>";
};
6F7100010000000000000019 /* Components */ = {
isa = PBXGroup;
children = (
6F710001000000000000000D /* GiftSendBannerView.swift */,
6F710001000000000000000E /* GiftSenderFormView.swift */,
);
path = Components;
sourceTree = "<group>";
};
6F710001000000000000001A /* Components */ = {
isa = PBXGroup;
children = (
6F710001000000000000000F /* GiftAgreementRow.swift */,
C78010010000000000000001 /* GiftContactInputRule.swift */,
C78010010000000000000002 /* GiftContactTextField.swift */,
);
path = Components;
sourceTree = "<group>";
};
74A9B4B9FC9DC78523CA8FAA /* Language */ = {
isa = PBXGroup;
children = (
@@ -5646,6 +5882,7 @@
976A594BED288A98C0EEA03C /* Component */ = {
isa = PBXGroup;
children = (
C77910010000000000000000 /* Address */,
C0A702100000000000000000 /* AudioContent */,
E92246F5C1254CBED72AD9AD /* AudioContentCard.swift */,
2D9C7222B946512FD4C4B499 /* Banner */,
@@ -5687,6 +5924,30 @@
path = FanTalk;
sourceTree = "<group>";
};
AC5200063012000000A5BBA3 /* Auth */ = {
isa = PBXGroup;
children = (
AC5200033012000000A5BBA3 /* AuthVerificationMock.swift */,
);
path = Auth;
sourceTree = "<group>";
};
AC5280043010280000A5BBA3 /* MyPage */ = {
isa = PBXGroup;
children = (
AC5280053010280000A5BBA3 /* Models */,
);
path = MyPage;
sourceTree = "<group>";
};
AC5280053010280000A5BBA3 /* Models */ = {
isa = PBXGroup;
children = (
AC5280033010280000A5BBA3 /* MyPageNoticeRoller.swift */,
);
path = Models;
sourceTree = "<group>";
};
B068C16B9D7F3F80901622E8 /* Button */ = {
isa = PBXGroup;
children = (
@@ -5944,6 +6205,7 @@
children = (
C0A740000000000000000008 /* UserCreatorChatModels.swift */,
C0A740000000000000000009 /* UserCreatorChatDisplayMessage.swift */,
C0A740000000000000000012 /* UserCreatorChatDatePresentation.swift */,
);
path = Models;
sourceTree = "<group>";
@@ -5970,6 +6232,7 @@
isa = PBXGroup;
children = (
C0A74000000000000000000E /* UserCreatorChatTextMessageItemView.swift */,
C0A740000000000000000013 /* UserCreatorChatDateSeparatorView.swift */,
);
path = Components;
sourceTree = "<group>";
@@ -5982,6 +6245,55 @@
path = Views;
sourceTree = "<group>";
};
C74810010000000000000003 /* Components */ = {
isa = PBXGroup;
children = (
C74810010000000000000002 /* GiftBoxCardView.swift */,
C74810010000000000000005 /* GiftBoxInfoBannerView.swift */,
C74810010000000000000004 /* GiftBoxEmptyView.swift */,
);
path = Components;
sourceTree = "<group>";
};
C75210010000000000000003 /* Components */ = {
isa = PBXGroup;
children = (
C75210010000000000000001 /* GiftProgressView.swift */,
C75210010000000000000002 /* GiftInfoSectionView.swift */,
C75310010000000000000001 /* SentGiftDetailContentView.swift */,
C77110010000000000000001 /* ReceivedGiftDetailContentView.swift */,
C75410010000000000000001 /* GiftDetailActionBar.swift */,
C75510010000000000000001 /* GiftCancelCompleteView.swift */,
);
path = Components;
sourceTree = "<group>";
};
C76210010000000000000002 /* Components */ = {
isa = PBXGroup;
children = (
C76210010000000000000001 /* GiftCourierPickerView.swift */,
);
path = Components;
sourceTree = "<group>";
};
C77210010000000000000003 /* RecipientAddress */ = {
isa = PBXGroup;
children = (
C77210010000000000000001 /* GiftRecipientAddressFormView.swift */,
C77210010000000000000002 /* GiftRecipientAddressViewModel.swift */,
);
path = RecipientAddress;
sourceTree = "<group>";
};
C77910010000000000000000 /* Address */ = {
isa = PBXGroup;
children = (
C77910010000000000000001 /* KakaoPostcodeSearchView.swift */,
C77910010000000000000002 /* SodaAddressInputView.swift */,
);
path = Address;
sourceTree = "<group>";
};
CC0100202FF0100000A5BBA3 /* Models */ = {
isa = PBXGroup;
children = (
@@ -6369,6 +6681,22 @@
path = List;
sourceTree = "<group>";
};
ED2920010000000000000001 /* Settings */ = {
isa = PBXGroup;
children = (
ED2920010000000000000002 /* Event */,
);
path = Settings;
sourceTree = "<group>";
};
ED2920010000000000000002 /* Event */ = {
isa = PBXGroup;
children = (
ED2910010000000000000001 /* EventDetailViewModel.swift */,
);
path = Event;
sourceTree = "<group>";
};
F158B5CDA48098FF3730E5B5 /* ViewModels */ = {
isa = PBXGroup;
children = (
@@ -6380,9 +6708,13 @@
F18179AD98929A1E018058E0 /* V2 */ = {
isa = PBXGroup;
children = (
ED2920010000000000000001 /* Settings */,
AC5280043010280000A5BBA3 /* MyPage */,
AC5200063012000000A5BBA3 /* Auth */,
976A594BED288A98C0EEA03C /* Component */,
D979B1B9166521052893A897 /* Main */,
CC0100242FF0100000A5BBA3 /* CreatorChannel */,
6F7100010000000000000013 /* Gift */,
);
path = V2;
sourceTree = "<group>";
@@ -6408,7 +6740,6 @@
40FE0E822A8361DF00252293 /* Resources */,
4055B6312CB4194C006F3D2F /* ShellScript */,
3B82B11E22594A438A9B51EF /* [CP] Embed Pods Frameworks */,
4A01C38173CBB0A3DAC22027 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@@ -6452,7 +6783,6 @@
40FE0EA22A8362A200252293 /* Frameworks */,
40FE0EA32A8362A200252293 /* Resources */,
28183D46159D813CE54C976C /* [CP] Embed Pods Frameworks */,
A693F0C20976651410F54E89 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@@ -6503,7 +6833,6 @@
};
};
buildConfigurationList = 40FE0E7F2A8361DF00252293 /* Build configuration list for PBXProject "SodaLive" */;
compatibilityVersion = "Xcode 14.0";
developmentRegion = ko;
hasScannedForEncodings = 0;
knownRegions = (
@@ -6532,6 +6861,7 @@
7D0E5FAF7AD538D1C2FED682 /* XCRemoteSwiftPackageReference "line-sdk-ios-swift" */,
405EC8B9303D97F30037B269 /* XCRemoteSwiftPackageReference "lottie-spm" */,
);
preferredProjectObjectVersion = 77;
productRefGroup = 40FE0E852A8361DF00252293 /* Products */;
projectDirPath = "";
projectRoot = "";
@@ -6680,48 +7010,6 @@
shellPath = /bin/sh;
shellScript = "# Type a script or drag a script file from your workspace to insert its path.\n\"${BUILD_DIR%/Build/*}/SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/run\"\n";
};
4A01C38173CBB0A3DAC22027 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-SodaLive/Pods-SodaLive-resources-${CONFIGURATION}-input-files.xcfilelist",
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-SodaLive/Pods-SodaLive-resources-${CONFIGURATION}-output-files.xcfilelist",
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SodaLive/Pods-SodaLive-resources.sh\"\n";
showEnvVarsInLog = 0;
};
A693F0C20976651410F54E89 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-SodaLive-dev/Pods-SodaLive-dev-resources-${CONFIGURATION}-input-files.xcfilelist",
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-SodaLive-dev/Pods-SodaLive-dev-resources-${CONFIGURATION}-output-files.xcfilelist",
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SodaLive-dev/Pods-SodaLive-dev-resources.sh\"\n";
showEnvVarsInLog = 0;
};
FAC97E5C197D279B3EE15B05 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@@ -6751,6 +7039,10 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
AC5280013010280000A5BBA3 /* MyPageNoticeRoller.swift in Sources */,
AC5200013012000000A5BBA3 /* AuthVerificationView.swift in Sources */,
AC5200043012000000A5BBA3 /* AuthVerificationMock.swift in Sources */,
AC5100013012000000A5BBA3 /* AuthContentSettingsSheet.swift in Sources */,
A4F100000000000000000001 /* LottieRefreshIndicator.swift in Sources */,
A4F100000000000000000003 /* LottieRefreshableScrollView.swift in Sources */,
400EDE592B31D2D7008E37B4 /* CreatorCommunityApi.swift in Sources */,
@@ -6871,6 +7163,39 @@
C0A711000000000000000001 /* MainContentAllTabResponse.swift in Sources */,
C0A711000000000000000002 /* MainContentAllApi.swift in Sources */,
C0A711000000000000000003 /* MainContentAllRepository.swift in Sources */,
6F7110010000000000000001 /* GiftModels.swift in Sources */,
6F7110010000000000000002 /* GiftApi.swift in Sources */,
6F7110010000000000000003 /* GiftRepository.swift in Sources */,
6F7110010000000000000004 /* GiftDisplayModels.swift in Sources */,
6F7110010000000000000005 /* GiftDisplayPolicy.swift in Sources */,
6F7110010000000000000006 /* GiftConstants.swift in Sources */,
6F7110010000000000000007 /* GiftSendView.swift in Sources */,
6F711001000000000000000C /* GiftSendViewModel.swift in Sources */,
6F711001000000000000000D /* GiftSendBannerView.swift in Sources */,
6F711001000000000000000E /* GiftSenderFormView.swift in Sources */,
C77911010000000000000001 /* KakaoPostcodeSearchView.swift in Sources */,
C77911010000000000000002 /* SodaAddressInputView.swift in Sources */,
6F711001000000000000000F /* GiftAgreementRow.swift in Sources */,
C78011010000000000000001 /* GiftContactInputRule.swift in Sources */,
C78011010000000000000002 /* GiftContactTextField.swift in Sources */,
6F7110010000000000000008 /* GiftBoxListView.swift in Sources */,
C74811010000000000000001 /* GiftBoxListViewModel.swift in Sources */,
C74811010000000000000002 /* GiftBoxCardView.swift in Sources */,
C74811010000000000000003 /* GiftBoxInfoBannerView.swift in Sources */,
C74811010000000000000004 /* GiftBoxEmptyView.swift in Sources */,
6F7110010000000000000009 /* GiftDetailView.swift in Sources */,
C75111010000000000000001 /* GiftDetailViewModel.swift in Sources */,
C75211010000000000000001 /* GiftProgressView.swift in Sources */,
C75211010000000000000002 /* GiftInfoSectionView.swift in Sources */,
C75311010000000000000001 /* SentGiftDetailContentView.swift in Sources */,
C77111010000000000000001 /* ReceivedGiftDetailContentView.swift in Sources */,
C77211010000000000000001 /* GiftRecipientAddressFormView.swift in Sources */,
C77211010000000000000002 /* GiftRecipientAddressViewModel.swift in Sources */,
C75411010000000000000001 /* GiftDetailActionBar.swift in Sources */,
C75511010000000000000001 /* GiftCancelCompleteView.swift in Sources */,
6F711001000000000000000A /* GiftTrackingRegistrationView.swift in Sources */,
C76111010000000000000001 /* GiftTrackingRegistrationViewModel.swift in Sources */,
C76211010000000000000001 /* GiftCourierPickerView.swift in Sources */,
C0A711000000000000000004 /* MainContentAllViewModel.swift in Sources */,
C0A711000000000000000005 /* MainContentAllView.swift in Sources */,
C0A711000000000000000006 /* MainContentSeriesThumbnailCard.swift in Sources */,
@@ -6883,6 +7208,8 @@
C0A741000000000000000007 /* MainChatFilter.swift in Sources */,
C0A741000000000000000008 /* UserCreatorChatModels.swift in Sources */,
C0A741000000000000000009 /* UserCreatorChatDisplayMessage.swift in Sources */,
C0A741000000000000000012 /* UserCreatorChatDatePresentation.swift in Sources */,
C0A741000000000000000013 /* UserCreatorChatDateSeparatorView.swift in Sources */,
C0A74100000000000000000A /* UserCreatorChatApi.swift in Sources */,
C0A74100000000000000000B /* UserCreatorChatRepository.swift in Sources */,
C0A74100000000000000000C /* UserCreatorChatWebSocketModels.swift in Sources */,
@@ -7456,6 +7783,7 @@
400EA77C2A89EDFE004992CF /* LiveNowAllView.swift in Sources */,
409143D52A85A64B00EEBFB1 /* ContentListViewModel.swift in Sources */,
409142DC2A84CF5800EEBFB1 /* EventDetailView.swift in Sources */,
ED2911010000000000000001 /* EventDetailViewModel.swift in Sources */,
40B28AAA2A839D8F008BE463 /* SignUpRequest.swift in Sources */,
403085AA2D1188B700CB61DE /* GenerateUrlResponse.swift in Sources */,
409142342A848B5300EEBFB1 /* LiveRoomPasswordDialog.swift in Sources */,
@@ -7632,7 +7960,6 @@
70E2CE7366BDBAC59BB39B41 /* AppDeepLinkHandler.swift in Sources */,
2B35B93B2F7253CADBC12A82 /* DateParser.swift in Sources */,
A3BDD0D3E14CD72B022AF6A7 /* FollowButtonImageAsset.swift in Sources */,
C45F071870A4DB48ABAE8BC5 /* YandexAdSupport.swift in Sources */,
FE3244627FFAD8667541CE01 /* ChannelDonationAllView.swift in Sources */,
843C3C5366C9D9DEE37878BF /* ChannelDonationItemView.swift in Sources */,
53E20A90F5D084820C7166E2 /* ChannelDonationViewModel.swift in Sources */,
@@ -7671,6 +7998,9 @@
7AB453CE38CA0B3D612E9467 /* AudioContentCard.swift in Sources */,
C0A704000000000000000001 /* AudioContentListRow.swift in Sources */,
2B65EEB59EE24059AC5DEADC /* BannerCarousel.swift in Sources */,
BA2910013010000000A5BBA3 /* SubBanner.swift in Sources */,
BA2910023010000000A5BBA3 /* SubBannerLinkOpener.swift in Sources */,
BA2910033010000000A5BBA3 /* SubBannerCarousel.swift in Sources */,
4572B5004B70CED10BDDB4C3 /* FollowAllButton.swift in Sources */,
BCA6CD9E57528C5F4203F1A5 /* CapsuleTabBar.swift in Sources */,
176AE05194A71107EA461B7B /* AiCharacterCard.swift in Sources */,
@@ -7853,6 +8183,10 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
AC5280023010280000A5BBA3 /* MyPageNoticeRoller.swift in Sources */,
AC5200023012000000A5BBA3 /* AuthVerificationView.swift in Sources */,
AC5200053012000000A5BBA3 /* AuthVerificationMock.swift in Sources */,
AC5100023012000000A5BBA3 /* AuthContentSettingsSheet.swift in Sources */,
A4F100000000000000000002 /* LottieRefreshIndicator.swift in Sources */,
A4F100000000000000000004 /* LottieRefreshableScrollView.swift in Sources */,
400EDE5A2B31D2D7008E37B4 /* CreatorCommunityApi.swift in Sources */,
@@ -8394,6 +8728,7 @@
400EA76C2A89C074004992CF /* GetLiveRoomTagResponse.swift in Sources */,
400EA77D2A89EDFE004992CF /* LiveNowAllView.swift in Sources */,
409142DD2A84CF5800EEBFB1 /* EventDetailView.swift in Sources */,
ED2913010000000000000001 /* EventDetailViewModel.swift in Sources */,
40B28AAB2A839D8F008BE463 /* SignUpRequest.swift in Sources */,
409142352A848B5300EEBFB1 /* LiveRoomPasswordDialog.swift in Sources */,
403085AB2D1188B700CB61DE /* GenerateUrlResponse.swift in Sources */,
@@ -8570,7 +8905,6 @@
560889894E241FA549958716 /* AppDeepLinkHandler.swift in Sources */,
4A951EA6E07524A0B650F4BF /* DateParser.swift in Sources */,
F8DB0226F6F44A7DBEF8B4CF /* FollowButtonImageAsset.swift in Sources */,
89AF41E6A46CD84BA469F272 /* YandexAdSupport.swift in Sources */,
E2C133B589E2DA7596B3BAEF /* ChannelDonationAllView.swift in Sources */,
F0F1F71CCA586A0CF5194FAB /* ChannelDonationItemView.swift in Sources */,
0470E68C6F302A131264E3AF /* ChannelDonationViewModel.swift in Sources */,
@@ -8609,6 +8943,9 @@
C9E67EC59CB2709A7A75A8B8 /* AudioContentCard.swift in Sources */,
C0A704000000000000000002 /* AudioContentListRow.swift in Sources */,
7389BAA35C414A1A0C1FE616 /* BannerCarousel.swift in Sources */,
BA2920013010000000A5BBA3 /* SubBanner.swift in Sources */,
BA2920023010000000A5BBA3 /* SubBannerLinkOpener.swift in Sources */,
BA2920033010000000A5BBA3 /* SubBannerCarousel.swift in Sources */,
9346B50E2D4531CE2CE373C8 /* FollowAllButton.swift in Sources */,
1690309E86928580115E94E2 /* CapsuleTabBar.swift in Sources */,
9B9CA62A8B2AED3A327FB06B /* AiCharacterCard.swift in Sources */,
@@ -8721,6 +9058,39 @@
C0A713000000000000000001 /* MainContentAllTabResponse.swift in Sources */,
C0A713000000000000000002 /* MainContentAllApi.swift in Sources */,
C0A713000000000000000003 /* MainContentAllRepository.swift in Sources */,
6F7130010000000000000001 /* GiftModels.swift in Sources */,
6F7130010000000000000002 /* GiftApi.swift in Sources */,
6F7130010000000000000003 /* GiftRepository.swift in Sources */,
6F7130010000000000000004 /* GiftDisplayModels.swift in Sources */,
6F7130010000000000000005 /* GiftDisplayPolicy.swift in Sources */,
6F7130010000000000000006 /* GiftConstants.swift in Sources */,
6F7130010000000000000007 /* GiftSendView.swift in Sources */,
6F713001000000000000000C /* GiftSendViewModel.swift in Sources */,
6F713001000000000000000D /* GiftSendBannerView.swift in Sources */,
6F713001000000000000000E /* GiftSenderFormView.swift in Sources */,
C77913010000000000000001 /* KakaoPostcodeSearchView.swift in Sources */,
C77913010000000000000002 /* SodaAddressInputView.swift in Sources */,
6F713001000000000000000F /* GiftAgreementRow.swift in Sources */,
C78013010000000000000002 /* GiftContactTextField.swift in Sources */,
C78013010000000000000001 /* GiftContactInputRule.swift in Sources */,
6F7130010000000000000008 /* GiftBoxListView.swift in Sources */,
C74813010000000000000001 /* GiftBoxListViewModel.swift in Sources */,
C74813010000000000000002 /* GiftBoxCardView.swift in Sources */,
C74813010000000000000003 /* GiftBoxInfoBannerView.swift in Sources */,
C74813010000000000000004 /* GiftBoxEmptyView.swift in Sources */,
6F7130010000000000000009 /* GiftDetailView.swift in Sources */,
C75113010000000000000001 /* GiftDetailViewModel.swift in Sources */,
C75213010000000000000001 /* GiftProgressView.swift in Sources */,
C75213010000000000000002 /* GiftInfoSectionView.swift in Sources */,
C75313010000000000000001 /* SentGiftDetailContentView.swift in Sources */,
C77113010000000000000001 /* ReceivedGiftDetailContentView.swift in Sources */,
C77213010000000000000001 /* GiftRecipientAddressFormView.swift in Sources */,
C77213010000000000000002 /* GiftRecipientAddressViewModel.swift in Sources */,
C75413010000000000000001 /* GiftDetailActionBar.swift in Sources */,
C75513010000000000000001 /* GiftCancelCompleteView.swift in Sources */,
6F713001000000000000000A /* GiftTrackingRegistrationView.swift in Sources */,
C76113010000000000000001 /* GiftTrackingRegistrationViewModel.swift in Sources */,
C76213010000000000000001 /* GiftCourierPickerView.swift in Sources */,
C0A713000000000000000004 /* MainContentAllViewModel.swift in Sources */,
C0A713000000000000000005 /* MainContentAllView.swift in Sources */,
C0A713000000000000000006 /* MainContentSeriesThumbnailCard.swift in Sources */,
@@ -8733,6 +9103,8 @@
C0A743000000000000000007 /* MainChatFilter.swift in Sources */,
C0A743000000000000000008 /* UserCreatorChatModels.swift in Sources */,
C0A743000000000000000009 /* UserCreatorChatDisplayMessage.swift in Sources */,
C0A743000000000000000012 /* UserCreatorChatDatePresentation.swift in Sources */,
C0A743000000000000000013 /* UserCreatorChatDateSeparatorView.swift in Sources */,
C0A74300000000000000000A /* UserCreatorChatApi.swift in Sources */,
C0A74300000000000000000B /* UserCreatorChatRepository.swift in Sources */,
C0A74300000000000000000C /* UserCreatorChatWebSocketModels.swift in Sources */,
@@ -8945,7 +9317,7 @@
CODE_SIGN_ENTITLEMENTS = SodaLive/SodaLive.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_ASSET_PATHS = "\"SodaLive/Preview Content\"";
DEVELOPMENT_TEAM = 3A8QGPMRXM;
ENABLE_PREVIEWS = YES;
@@ -8967,7 +9339,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.56.2;
MARKETING_VERSION = 1.58.0;
PRODUCT_BUNDLE_IDENTIFIER = kr.co.vividnext.sodalive;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -8986,7 +9358,7 @@
CODE_SIGN_ENTITLEMENTS = SodaLive/SodaLive.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_ASSET_PATHS = "\"SodaLive/Preview Content\"";
DEVELOPMENT_TEAM = 3A8QGPMRXM;
ENABLE_PREVIEWS = YES;
@@ -9008,7 +9380,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.56.2;
MARKETING_VERSION = 1.58.0;
PRODUCT_BUNDLE_IDENTIFIER = kr.co.vividnext.sodalive;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -9052,6 +9424,7 @@
PRODUCT_BUNDLE_IDENTIFIER = kr.co.vividnext.sodalive.debug2;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) AUTH_VERIFICATION_MOCK";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
@@ -9092,6 +9465,7 @@
PRODUCT_BUNDLE_IDENTIFIER = kr.co.vividnext.sodalive.debug2;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) AUTH_VERIFICATION_MOCK";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_my_present.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

@@ -9,7 +9,7 @@
"scale" : "2x"
},
{
"filename" : "img_apply_creator_kr.png",
"filename" : "img_apply_creator.png",
"idiom" : "universal",
"scale" : "3x"
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 342 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 286 KiB

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_send_gift.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 815 B

+145 -25
View File
@@ -1,11 +1,15 @@
import Foundation
import AppsFlyerLib
enum AppDeepLinkAction {
case live(roomId: Int)
case userCreatorChat(roomId: Int)
case content(contentId: Int)
case series(seriesId: Int)
case community(creatorId: Int, postId: Int?)
case giftDetail(applicationNo: String)
case community(postId: Int)
case eventDetail(eventId: Int)
case message
case audition
}
@@ -16,7 +20,14 @@ enum AppDeepLinkSource {
}
enum AppDeepLinkHandler {
private static var navigatingEventId: Int?
static func handle(url: URL, source: AppDeepLinkSource = .external) -> Bool {
if isOneLink(url) {
AppsFlyerLib.shared().performOnAppAttribution(with: url)
return true
}
guard isSupportedScheme(url) else {
return false
}
@@ -25,16 +36,58 @@ enum AppDeepLinkHandler {
return false
}
dispatch(action: action, source: source)
return true
}
static func handleEventDeepLink(result: DeepLinkResult) -> Bool {
guard result.status == .found,
let clickEvent = result.deepLink?.clickEvent,
clickEvent["deep_link_value"] as? String == "event-detail",
let id = eventId(clickEvent["deep_link_sub5"] as? String) else {
return false
}
dispatch(action: .eventDetail(eventId: id))
return true
}
static func handlePushDeepLink(userInfo: [AnyHashable: Any]) -> Bool {
if userInfo["notifly_message_type"] as? String == "push-notification" {
if let url = userInfo["url"] as? URL, !url.absoluteString.isEmpty {
return true
}
if let urlString = userInfo["url"] as? String, !urlString.isEmpty {
return true
}
}
let deepLinkString = (userInfo["deep_link"] as? String ?? "")
.trimmingCharacters(in: .whitespacesAndNewlines)
guard !deepLinkString.isEmpty else { return false }
if let url = URL(string: deepLinkString), isOneLink(url) {
AppsFlyerLib.shared().handlePushNotification(userInfo)
} else {
_ = handle(urlString: deepLinkString)
}
return true
}
private static func dispatch(action: AppDeepLinkAction, source: AppDeepLinkSource = .external) {
DispatchQueue.main.async {
if case .splash = AppState.shared.rootStep {
if case .eventDetail(let eventId) = action,
case .eventDetail(let pendingId)? = AppState.shared.pendingDeepLinkAction,
pendingId == eventId {
return
}
AppState.shared.pendingDeepLinkAction = action
return
}
apply(action: action, source: source)
}
return true
}
static func handle(urlString: String, source: AppDeepLinkSource = .external) -> Bool {
@@ -70,16 +123,41 @@ enum AppDeepLinkHandler {
guard seriesId > 0 else { return }
AppState.shared.setAppStep(step: .seriesDetail(seriesId: seriesId))
case .community(let creatorId, let postId):
guard creatorId > 0 else { return }
case .giftDetail(let applicationNo):
AppState.shared.setAppStep(step: .giftDetail(applicationNo: applicationNo))
if let postId = postId, postId > 0 {
AppState.shared.setPendingCommunityCommentDeepLink(creatorId: creatorId, postId: postId)
} else {
AppState.shared.clearPendingCommunityCommentDeepLink()
}
case .community(let postId):
guard postId > 0 else { return }
AppState.shared.setAppStep(step: .creatorChannelCommunityPostDetail(postId: postId))
AppState.shared.setAppStep(step: .creatorCommunityAll(creatorId: creatorId))
case .eventDetail(let eventId):
guard eventId > 0, navigatingEventId != eventId else { return }
navigatingEventId = eventId
AppState.shared.requestExternalNavigation(
navigationAction: {
guard navigatingEventId == eventId else { return }
AppState.shared.setAppStep(
step: .eventDetail(eventId: eventId),
ifCurrentStep: { currentStep in
guard navigatingEventId == eventId else { return false }
if case .eventDetail(let currentId) = currentStep {
return currentId != eventId
}
return true
},
completion: {
if navigatingEventId == eventId {
navigatingEventId = nil
}
}
)
},
cancelAction: {
if navigatingEventId == eventId {
navigatingEventId = nil
}
}
)
case .message:
AppState.shared.setAppStep(step: .message)
@@ -89,6 +167,26 @@ enum AppDeepLinkHandler {
}
}
private static func isOneLink(_ url: URL) -> Bool {
guard let components = URLComponents(url: url, resolvingAgainstBaseURL: false) else {
return false
}
return components.scheme?.lowercased() == "https"
&& components.host?.lowercased() == "voiceon.onelink.me"
&& components.user == nil && components.password == nil
&& (components.port == nil || components.port == 443)
}
private static func eventId(_ identifier: String?) -> Int? {
guard let identifier = identifier, !identifier.isEmpty,
identifier.utf8.allSatisfy({ $0 >= 48 && $0 <= 57 }),
let value = Int64(identifier), value > 0 else {
return nil
}
return Int(exactly: value)
}
private static func isSupportedScheme(_ url: URL) -> Bool {
guard let scheme = url.scheme?.lowercased() else {
return false
@@ -100,6 +198,22 @@ enum AppDeepLinkHandler {
private static func parseAction(url: URL) -> AppDeepLinkAction? {
let components = URLComponents(url: url, resolvingAgainstBaseURL: false)
let host = components?.host?.lowercased() ?? ""
let pathRoute = url.pathComponents.first { $0 != "/" && !$0.isEmpty }?.lowercased()
if host == "event-detail" || (host.isEmpty && pathRoute == "event-detail") {
let scheme = url.scheme?.lowercased()
guard scheme == "voiceon" || scheme == "voiceon-test" else { return nil }
let path = url.pathComponents.filter { $0 != "/" && !$0.isEmpty }
guard path.count == (host.isEmpty ? 2 : 1), let id = eventId(path.last) else {
return nil
}
return .eventDetail(eventId: id)
}
if host == "community" || (host.isEmpty && pathRoute == "community") {
return parsePathStyle(url: url, components: components)
}
if let routeAction = parsePathStyle(url: url, components: components) {
return routeAction
@@ -148,8 +262,18 @@ enum AppDeepLinkHandler {
return .series(seriesId: value)
}
if let value = queryMap["deeplinkvalue"]?.trimmingCharacters(in: .whitespacesAndNewlines),
value.caseInsensitiveCompare("GIFT_DETAIL") == .orderedSame,
let applicationNo = queryMap["deeplinkid"]?.trimmingCharacters(in: .whitespacesAndNewlines),
!applicationNo.isEmpty {
return .giftDetail(applicationNo: applicationNo)
}
if let communityId = queryMap["community_id"], let value = Int(communityId), value > 0 {
return .community(creatorId: value, postId: communityPostId(queryMap: queryMap))
guard let postId = communityPostId(queryMap: queryMap) else {
return nil
}
return .community(postId: postId)
}
if queryMap["message_id"] != nil {
@@ -189,18 +313,18 @@ enum AppDeepLinkHandler {
}
return .series(seriesId: seriesId)
case "community":
let postId = communityPostId(queryItems: components?.queryItems)
if let identifier = identifier, let creatorId = Int(identifier), creatorId > 0 {
return .community(creatorId: creatorId, postId: postId)
}
guard let creatorId = fallbackCommunityCreatorId() else {
case "gift-detail":
guard let applicationNo = identifier?.trimmingCharacters(in: .whitespacesAndNewlines),
!applicationNo.isEmpty else {
return nil
}
return .giftDetail(applicationNo: applicationNo)
return .community(creatorId: creatorId, postId: postId)
case "community":
guard let postId = communityPostId(queryItems: components?.queryItems) else {
return nil
}
return .community(postId: postId)
case "message":
return .message
@@ -238,8 +362,4 @@ enum AppDeepLinkHandler {
return nil
}
private static func fallbackCommunityCreatorId() -> Int? {
let userId = UserDefaults.int(forKey: .userId)
return userId > 0 ? userId : nil
}
}
+3 -9
View File
@@ -15,7 +15,6 @@ import FirebaseCore
import FirebaseAnalytics
import FirebaseMessaging
import LineSDK
import YandexMobileAds
class AppDelegate: UIResponder, UIApplicationDelegate {
@@ -33,9 +32,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
Messaging.messaging().delegate = self
setupAppsFlyer()
// YandexAds 초기화
YandexAds.initializeSDK(completionHandler: nil)
// For iOS 10 display notification (sent via APNS)
UNUserNotificationCenter.current().delegate = self
@@ -105,6 +101,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
AppsFlyerLib.shared().delegate = self
AppsFlyerLib.shared().deepLinkDelegate = self
AppsFlyerLib.shared().addPushNotificationDeepLinkPath(["deep_link"])
}
private func logUtmInFirebase() {
@@ -225,6 +222,7 @@ extension AppDelegate: DeepLinkDelegate {
}
logUtmInFirebase()
_ = AppDeepLinkHandler.handleEventDeepLink(result: result)
}
}
@@ -276,11 +274,7 @@ extension AppDelegate : UNUserNotificationCenterDelegate {
Messaging.messaging().appDidReceiveMessage(userInfo)
Notifly.userNotificationCenter(center, didReceive: response)
let deepLinkString = (userInfo["deep_link"] as? String ?? "")
.trimmingCharacters(in: .whitespacesAndNewlines)
if !deepLinkString.isEmpty {
_ = AppDeepLinkHandler.handle(urlString: deepLinkString)
if AppDeepLinkHandler.handlePushDeepLink(userInfo: userInfo) {
completionHandler()
return
}
+20 -2
View File
@@ -110,8 +110,15 @@ class AppState: ObservableObject {
routeStepMap[route]
}
func setAppStep(step: AppStep) {
func setAppStep(
step: AppStep,
ifCurrentStep matches: ((AppStep) -> Bool)? = nil,
completion: @escaping () -> Void = {}
) {
DispatchQueue.main.async {
defer { completion() }
guard matches?(self.appStep) ?? true else { return }
switch step {
case .splash, .main:
self.liveDetailSheet = nil
@@ -139,8 +146,17 @@ class AppState: ObservableObject {
}
}
func replaceCurrentAppStep(step: AppStep) {
func replaceCurrentAppStep(
step: AppStep,
ifCurrentStep matches: ((AppStep) -> Bool)? = nil,
completion: @escaping (Bool) -> Void = { _ in }
) {
DispatchQueue.main.async {
guard matches?(self.appStep) ?? true else {
completion(false)
return
}
if let route = self.navigationPath.popLast() {
self.routeStepMap.removeValue(forKey: route)
}
@@ -149,6 +165,7 @@ class AppState: ObservableObject {
self.routeStepMap[route] = step
self.navigationPath.append(route)
self.appStep = step
completion(true)
}
}
@@ -186,6 +203,7 @@ class AppState: ObservableObject {
return
}
pendingExternalNavigationCancelAction?()
pendingExternalNavigationAction = navigationAction
pendingExternalNavigationCancelAction = cancelAction
isShowLeaveLiveNavigationDialog = true
+9 -1
View File
@@ -34,7 +34,7 @@ enum AppStep {
case events
case eventDetail(event: EventItem)
case eventDetail(eventId: Int)
case terms
@@ -196,4 +196,12 @@ enum AppStep {
case contentOverview(type: ContentOverviewType = .newAndHotAudio)
case seriesMain
case giftSend(recipientMemberId: Int, recipientCreatorNickname: String, recipientCreatorProfileImageUrl: String)
case giftBoxList
case giftDetail(applicationNo: String)
case giftTrackingRegistration(applicationNo: String)
}
@@ -36,11 +36,6 @@ struct CharacterView: View {
}
}
YandexInlineBannerView(
placement: .chatCharacterList,
horizontalPadding: 24
)
.padding(.vertical, -24)
// 인기 캐릭터 섹션
if !viewModel.popularCharacters.isEmpty {
+16 -19
View File
@@ -7,7 +7,6 @@
import SwiftUI
import Bootpay
import BootpayUI
struct ChatTabView: View {
@AppStorage("token") private var token: String = UserDefaults.string(forKey: UserDefaultsKey.token)
@AppStorage("auth") private var auth: Bool = UserDefaults.bool(forKey: UserDefaultsKey.auth)
@@ -159,33 +158,30 @@ struct ChatTabView: View {
payload.orderName = "본인인증"
payload.authenticationId = "\(UserDefaults.string(forKey: .nickname))__\(String(NSTimeIntervalSince1970))"
}
.fullScreenCover(isPresented: $isShowAuthView) {
BootpayUI(payload: payload, requestType: BootpayRequest.TYPE_AUTHENTICATION)
.onConfirm { _ in
true
}
.onCancel { _ in
.fullScreenCover(isPresented: $isShowAuthView, onDismiss: mypageViewModel.presentAuthContentSettings) {
AuthVerificationView(
payload: payload,
onCancel: {
isShowAuthView = false
}
.onError { _ in
},
onError: {
AppState.shared.errorMessage = I18n.Chat.Auth.authenticationError
AppState.shared.isShowErrorPopup = true
isShowAuthView = false
}
.onDone {
DEBUG_LOG("onDone: \($0)")
},
onDone: {
let action = pendingAction
mypageViewModel.authVerify($0) {
auth = true
isShowAuthView = false
if let action = pendingAction {
pendingAction = nil
action()
}
pendingAction = nil
action?()
}
}
.onClose {
isShowAuthView = false
},
onClose: {
isShowAuthView = false
}
)
}
if isShowAuthConfirmView {
@@ -206,6 +202,7 @@ struct ChatTabView: View {
)
}
}
.authContentSettings(viewModel: mypageViewModel, onCancel: { pendingAction = nil })
}
}
@@ -22,10 +22,6 @@ struct OriginalTabView: View {
ScrollView(.vertical, showsIndicators: false) {
VStack(spacing: 12) {
YandexInlineBannerView(
placement: .chatOriginalTabTop,
horizontalPadding: horizontalPadding
)
LazyVGrid(
columns: Array(
@@ -277,21 +277,6 @@ final class ChatRoomViewModel: ObservableObject {
purchaseChatQuota(chargeType: .can, canOption: canOption)
}
func showRewardedAdForChatQuota() {
_Concurrency.Task {
let isShown = await YandexRewardedAdManager.shared.showAdIfAvailable(for: .chatRoomQuota) { [weak self] in
self?.purchaseChatQuota(chargeType: .ad, canOption: nil)
}
if !isShown {
await MainActor.run {
errorMessage = I18n.Chat.Room.rewardedAdLoadFailed
isShowPopup = true
}
}
}
}
private func purchaseChatQuota(
chargeType: ChatRoomQuotaChargeType,
canOption: ChatRoomQuotaCanOption?
@@ -467,15 +452,6 @@ final class ChatRoomViewModel: ObservableObject {
private func updateQuota(totalRemaining: Int) {
self.totalRemaining = totalRemaining
showQuotaNoticeView = totalRemaining <= 0
prepareRewardedAdIfNeeded(totalRemaining: totalRemaining)
}
private func prepareRewardedAdIfNeeded(totalRemaining: Int) {
guard totalRemaining <= 1 else { return }
_Concurrency.Task {
await YandexRewardedAdManager.shared.preloadAd(for: .chatRoomQuota)
}
}
private func getSavedBackgroundImageId() -> Int? {
@@ -21,7 +21,6 @@ struct ChatQuotaPurchaseRequest: Encodable {
enum ChatRoomQuotaChargeType: String, Encodable {
case can = "CAN"
case ad = "AD"
}
enum ChatRoomQuotaCanOption: String, Encodable {
@@ -15,10 +15,6 @@ struct TalkView: View {
BaseView(isLoading: $viewModel.isLoading) {
ScrollView(.vertical, showsIndicators: false) {
LazyVStack(spacing: 24) {
YandexInlineBannerView(
placement: .chatTalkTabTop,
horizontalPadding: 24
)
if viewModel.talkRooms.isEmpty {
Text(I18n.Chat.Talk.emptyMessage)
@@ -1,316 +0,0 @@
//
// YandexAdSupport.swift
// SodaLive
//
// Created by OpenCode on 2026/04/28.
//
import SwiftUI
import YandexMobileAds
enum YandexBannerPlacement {
case liveTab
case liveDetail
case creatorCommunityAll
case seriesMainHome
case seriesMainDayOfWeek
case seriesMainByGenre
case pushNotificationList
case notificationReceiveSettings
case chatCharacterList
case chatOriginalTabTop
case chatTalkTabTop
}
enum YandexRewardedPlacement {
case chatRoomQuota
}
enum YandexAdUnitIdProvider {
static func banner(for placement: YandexBannerPlacement) -> String {
switch placement {
case .liveTab:
YANDEX_LIVE_TAB_BANNER_AD_UNIT_ID
case .liveDetail:
YANDEX_LIVE_DETAIL_BANNER_AD_UNIT_ID
case .creatorCommunityAll:
YANDEX_CREATOR_COMMUNITY_ALL_BANNER_AD_UNIT_ID
case .seriesMainHome:
YANDEX_SERIES_MAIN_HOME_BANNER_AD_UNIT_ID
case .seriesMainDayOfWeek:
YANDEX_SERIES_MAIN_DAY_OF_WEEK_BANNER_AD_UNIT_ID
case .seriesMainByGenre:
YANDEX_SERIES_MAIN_BY_GENRE_BANNER_AD_UNIT_ID
case .pushNotificationList:
YANDEX_PUSH_NOTIFICATION_LIST_BANNER_AD_UNIT_ID
case .notificationReceiveSettings:
YANDEX_NOTIFICATION_RECEIVE_SETTINGS_BANNER_AD_UNIT_ID
case .chatCharacterList:
YANDEX_CHAT_CHARACTER_LIST_BANNER_AD_UNIT_ID
case .chatOriginalTabTop:
YANDEX_CHAT_ORIGINAL_TAB_TOP_BANNER_AD_UNIT_ID
case .chatTalkTabTop:
YANDEX_CHAT_TALK_TAB_TOP_BANNER_AD_UNIT_ID
}
}
static func rewarded(for placement: YandexRewardedPlacement) -> String {
switch placement {
case .chatRoomQuota:
YANDEX_CHAT_ROOM_QUOTA_REWARDED_AD_UNIT_ID
}
}
}
struct YandexInlineBannerView: View {
let placement: YandexBannerPlacement
var maxHeight: CGFloat = 90
var horizontalPadding: CGFloat = 13.3
@State private var bannerHeight: CGFloat = 0
@State private var isLoadFailed = true
var body: some View {
GeometryReader { proxy in
let width = max(proxy.size.width - (horizontalPadding * 2), 1)
let resolvedHeight = isLoadFailed ? 0 : (bannerHeight > 0 ? bannerHeight : maxHeight)
YandexInlineBannerContainer(
placement: placement,
width: width,
maxHeight: maxHeight,
bannerHeight: $bannerHeight,
isLoadFailed: $isLoadFailed
)
.frame(width: width, height: resolvedHeight)
.padding(.horizontal, horizontalPadding)
}
.frame(height: isLoadFailed ? 0 : (bannerHeight > 0 ? bannerHeight : maxHeight))
}
}
private struct YandexInlineBannerContainer: UIViewRepresentable {
let placement: YandexBannerPlacement
let width: CGFloat
let maxHeight: CGFloat
@Binding var bannerHeight: CGFloat
@Binding var isLoadFailed: Bool
func makeCoordinator() -> Coordinator {
Coordinator(parent: self)
}
func makeUIView(context: Context) -> UIView {
let view = UIView()
view.backgroundColor = .clear
return view
}
func updateUIView(_ uiView: UIView, context: Context) {
context.coordinator.parent = self
context.coordinator.configureIfNeeded(containerView: uiView)
}
final class Coordinator: NSObject, BannerAdViewDelegate {
var parent: YandexInlineBannerContainer
private weak var containerView: UIView?
private var bannerAdView: BannerAdView?
private var currentWidth: CGFloat = 0
init(parent: YandexInlineBannerContainer) {
self.parent = parent
}
func configureIfNeeded(containerView: UIView) {
self.containerView = containerView
let roundedWidth = parent.width.rounded(.down)
guard bannerAdView == nil || abs(currentWidth - roundedWidth) > 0.5 else {
return
}
currentWidth = roundedWidth
DispatchQueue.main.async {
self.parent.bannerHeight = 0
self.parent.isLoadFailed = false
}
bannerAdView?.removeFromSuperview()
let adSize = BannerAdSize.inline(width: roundedWidth, maxHeight: parent.maxHeight)
let bannerAdView = BannerAdView(adSize: adSize)
bannerAdView.translatesAutoresizingMaskIntoConstraints = false
bannerAdView.delegate = self
containerView.addSubview(bannerAdView)
NSLayoutConstraint.activate([
bannerAdView.topAnchor.constraint(equalTo: containerView.topAnchor),
bannerAdView.leadingAnchor.constraint(equalTo: containerView.leadingAnchor),
bannerAdView.trailingAnchor.constraint(equalTo: containerView.trailingAnchor),
bannerAdView.bottomAnchor.constraint(equalTo: containerView.bottomAnchor)
])
self.bannerAdView = bannerAdView
bannerAdView.loadAd(with: AdRequest(adUnitID: YandexAdUnitIdProvider.banner(for: parent.placement)))
}
func bannerAdViewDidLoad(_ adView: BannerAdView) {
adView.layoutIfNeeded()
let measuredHeight = adView.bounds.height > 0 ? adView.bounds.height : parent.maxHeight
DispatchQueue.main.async {
self.parent.bannerHeight = measuredHeight
self.parent.isLoadFailed = false
}
}
func bannerAdViewDidFailLoading(_ adView: BannerAdView, error: Error) {
DispatchQueue.main.async {
self.parent.bannerHeight = 0
self.parent.isLoadFailed = true
}
}
func bannerAdViewDidClick(_ adView: BannerAdView) {
}
func bannerAdView(_ adView: BannerAdView, didTrackImpression impressionData: ImpressionData?) {
}
}
}
@MainActor
final class YandexRewardedAdManager: NSObject {
static let shared = YandexRewardedAdManager()
private var rewardedAd: RewardedAd?
private var rewardedAdLoader: RewardedAdLoader?
private var currentPlacement: YandexRewardedPlacement?
private var pendingRewardAction: (@MainActor () -> Void)?
private var rewardedPlacement: YandexRewardedPlacement?
private var isLoading = false
func preloadAd(for placement: YandexRewardedPlacement) {
guard !isLoading else {
return
}
if currentPlacement == placement, rewardedAd != nil {
return
}
let loader = RewardedAdLoader()
rewardedAdLoader = loader
rewardedAd = nil
currentPlacement = placement
isLoading = true
Task {
do {
let loadedAd = try await loader.loadAd(with: AdRequest(adUnitID: YandexAdUnitIdProvider.rewarded(for: placement)))
guard currentPlacement == placement else {
isLoading = false
return
}
loadedAd.delegate = self
rewardedAd = loadedAd
} catch {
if currentPlacement == placement {
rewardedAd = nil
}
}
if currentPlacement == placement {
isLoading = false
}
}
}
func showAdIfAvailable(for placement: YandexRewardedPlacement, onReward: @escaping @MainActor () -> Void) -> Bool {
guard let presenter = presentingViewController(), let rewardedAd, currentPlacement == placement else {
preloadAd(for: placement)
return false
}
pendingRewardAction = onReward
rewardedPlacement = placement
rewardedAd.show(from: presenter)
return true
}
private func completeRewardIfNeeded() {
let action = pendingRewardAction
pendingRewardAction = nil
action?()
}
private func resetAndPreload() {
pendingRewardAction = nil
rewardedAd = nil
if let rewardedPlacement {
self.rewardedPlacement = nil
preloadAd(for: rewardedPlacement)
}
}
private func presentingViewController() -> UIViewController? {
guard
let rootViewController = UIApplication.shared.connectedScenes
.compactMap({ $0 as? UIWindowScene })
.flatMap({ $0.windows })
.first(where: { $0.isKeyWindow })?
.rootViewController
else {
return nil
}
var topViewController = rootViewController
while let presentedViewController = topViewController.presentedViewController {
topViewController = presentedViewController
}
return topViewController
}
}
extension YandexRewardedAdManager: RewardedAdDelegate {
func rewardedAd(_ rewardedAd: RewardedAd, didReward reward: Reward) {
DEBUG_LOG("리워드 광고 보상 받기 성공")
completeRewardIfNeeded()
}
func rewardedAd(_ rewardedAd: RewardedAd, didFailToShow error: Error) {
DEBUG_LOG("리워드 광고 에러")
resetAndPreload()
}
func rewardedAdDidShow(_ rewardedAd: RewardedAd) {
}
func rewardedAdDidDismiss(_ rewardedAd: RewardedAd) {
DEBUG_LOG("리워드 광고 닫기")
resetAndPreload()
}
func rewardedAdDidClick(_ rewardedAd: RewardedAd) {
}
func rewardedAd(_ rewardedAd: RewardedAd, didTrackImpression impressionData: ImpressionData?) {
}
}
@@ -103,7 +103,7 @@ private struct ContentMainBannerPage: View {
.onTapGesture {
switch item.type {
case .EVENT:
AppState.shared.setAppStep(step: .eventDetail(event: item.eventItem!))
AppState.shared.setAppStep(step: .eventDetail(eventId: item.eventItem!.id))
case .CREATOR:
AppState.shared.setAppStep(step: .creatorDetail(userId: item.creatorId!))
case .SERIES:
@@ -126,7 +126,7 @@ struct ContentMainBannerImageView: View {
.onTapGesture {
switch item.type {
case .EVENT:
AppState.shared.setAppStep(step: .eventDetail(event: item.eventItem!))
AppState.shared.setAppStep(step: .eventDetail(eventId: item.eventItem!.id))
case .CREATOR:
AppState.shared.setAppStep(step: .creatorDetail(userId: item.creatorId!))
case .SERIES:
@@ -29,9 +29,6 @@ struct SeriesMainByGenreView: View {
let width = (screenSize().width - (horizontalPadding * 2) - gridSpacing) / 2
VStack(spacing: 16) {
if !viewModel.genreList.isEmpty {
YandexInlineBannerView(placement: .seriesMainByGenre, horizontalPadding: 24)
}
LazyVGrid(
columns: Array(
@@ -62,7 +62,6 @@ struct SeriesMainDayOfWeekView: View {
let width = (screenSize().width - (horizontalPadding * 2) - gridSpacing) / 2
VStack(spacing: 16) {
YandexInlineBannerView(placement: .seriesMainDayOfWeek, horizontalPadding: 24)
LazyVGrid(
columns: Array(
@@ -55,7 +55,6 @@ struct SeriesMainHomeView: View {
}
}
YandexInlineBannerView(placement: .seriesMainHome, horizontalPadding: 24)
if !viewModel.recommendSeriesList.isEmpty {
VStack(alignment: .leading, spacing: 16) {
+14 -2
View File
@@ -146,8 +146,8 @@ struct AppStepLayerView: View {
case .events:
EventListView()
case .eventDetail(let event):
EventDetailView(event: event)
case .eventDetail(let eventId):
EventDetailView(eventId: eventId)
case .terms:
TermsView(isPrivacyPolicy: false)
@@ -374,6 +374,18 @@ struct AppStepLayerView: View {
case .seriesMain:
SeriesMainView()
case .giftSend(let recipientMemberId, let recipientCreatorNickname, let recipientCreatorProfileImageUrl):
GiftSendView(recipientMemberId: recipientMemberId, recipientCreatorNickname: recipientCreatorNickname, recipientCreatorProfileImageUrl: recipientCreatorProfileImageUrl)
case .giftBoxList:
GiftBoxListView()
case .giftDetail(let applicationNo):
GiftDetailView(applicationNo: applicationNo)
case .giftTrackingRegistration(let applicationNo):
GiftTrackingRegistrationView(applicationNo: applicationNo)
case .main:
EmptyView()
.frame(width: 0, height: 0, alignment: .topLeading)
@@ -11,7 +11,6 @@ let BASE_URL = "https://test-api.sodalive.net"
let APPLY_SODALIVE_CREATOR = "https://forms.gle/mmhJKmijjVRnwtdZ7"
let AGORA_APP_ID = "b96574e191a9430fa54c605528aa3ef7"
let AGORA_APP_CERTIFICATE = "ae18ade3afcf4086bd4397726eb0654c"
let BOOTPAY_APP_ID = "6242a7772701800023f68b2f"
let BOOTPAY_APP_HECTO_ID = "667fca5d3bab7404f831c3e5"
@@ -32,18 +31,3 @@ let LINE_CHANNEL_ID = "2008995582"
let AGORA_CUSTOMER_ID = "de5dd9ea151f4a43ba1ad8411817b169"
let AGORA_CUSTOMER_SECRET = "3855da8bc5ae4743af8bf4f87408b515"
let YANDEX_LIVE_TAB_BANNER_AD_UNIT_ID = "R-M-19140297-3"
let YANDEX_LIVE_DETAIL_BANNER_AD_UNIT_ID = "R-M-19140297-4"
let YANDEX_CONTENT_DETAIL_BANNER_AD_UNIT_ID = "R-M-19140297-5"
let YANDEX_CONTENT_DETAIL_INTERSTITIAL_AD_UNIT_ID = "R-M-19140297-6"
let YANDEX_CREATOR_COMMUNITY_ALL_BANNER_AD_UNIT_ID = "R-M-19140297-7"
let YANDEX_SERIES_MAIN_HOME_BANNER_AD_UNIT_ID = "R-M-19140297-8"
let YANDEX_SERIES_MAIN_DAY_OF_WEEK_BANNER_AD_UNIT_ID = "R-M-19140297-9"
let YANDEX_SERIES_MAIN_BY_GENRE_BANNER_AD_UNIT_ID = "R-M-19140297-10"
let YANDEX_PUSH_NOTIFICATION_LIST_BANNER_AD_UNIT_ID = "R-M-19140297-11"
let YANDEX_NOTIFICATION_RECEIVE_SETTINGS_BANNER_AD_UNIT_ID = "R-M-19140297-12"
let YANDEX_CHAT_CHARACTER_LIST_BANNER_AD_UNIT_ID = "R-M-19140297-13"
let YANDEX_CHAT_ORIGINAL_TAB_TOP_BANNER_AD_UNIT_ID = "R-M-19140297-14"
let YANDEX_CHAT_TALK_TAB_TOP_BANNER_AD_UNIT_ID = "R-M-19140297-15"
let YANDEX_CHAT_ROOM_QUOTA_REWARDED_AD_UNIT_ID = "R-M-19140297-16"
@@ -47,7 +47,6 @@ struct CreatorCommunityAllView: View {
communityViewTypeTabView
YandexInlineBannerView(placement: .creatorCommunityAll)
if isGridMode {
gridContentView
@@ -41,6 +41,10 @@ enum SodaTypography {
}
}
func localizedFontName(locale: Locale = .autoupdatingCurrent) -> String? {
fontName(for: .localized, weight: weight, locale: locale)
}
var weight: SwiftUI.Font.Weight {
switch self {
case .heading1, .heading2, .heading3, .heading4, .body1, .body4, .caption1:
@@ -43,6 +43,14 @@ extension UserDefaults {
}
static func set(_ value: String, forKey key: UserDefaultsKey) {
#if AUTH_VERIFICATION_MOCK
if key == .token {
AuthVerificationMock.shared.resetSession {
UserDefaults.standard.set(value, forKey: key.rawValue)
}
return
}
#endif
let key = key.rawValue
UserDefaults.standard.set(value, forKey: key)
}
@@ -78,6 +86,12 @@ extension UserDefaults {
}
static func reset() {
#if AUTH_VERIFICATION_MOCK
AuthVerificationMock.shared.resetSession {
UserDefaultsKey.allCases.filter { $0 != .pushToken }.forEach { UserDefaults.standard.removeObject(forKey: $0.rawValue) }
}
#else
UserDefaultsKey.allCases.filter { $0 != .pushToken }.forEach { UserDefaults.standard.removeObject(forKey: $0.rawValue) }
#endif
}
}
+16 -19
View File
@@ -7,7 +7,6 @@
import SwiftUI
import Bootpay
import BootpayUI
struct HomeTabView: View {
@StateObject var viewModel = HomeTabViewModel()
@@ -479,36 +478,34 @@ struct HomeTabView: View {
viewModel.fetchData()
}
.fullScreenCover(isPresented: $isShowAuthView) {
BootpayUI(payload: payload, requestType: BootpayRequest.TYPE_AUTHENTICATION)
.onConfirm { _ in
true
}
.onCancel { _ in
.fullScreenCover(isPresented: $isShowAuthView, onDismiss: mypageViewModel.presentAuthContentSettings) {
AuthVerificationView(
payload: payload,
onCancel: {
isShowAuthView = false
}
.onError { _ in
},
onError: {
AppState.shared.errorMessage = I18n.Chat.Auth.authenticationError
AppState.shared.isShowErrorPopup = true
isShowAuthView = false
}
.onDone {
DEBUG_LOG("onDone: \($0)")
},
onDone: {
let action = pendingAction
mypageViewModel.authVerify($0) {
auth = true
isShowAuthView = false
if let action = pendingAction {
pendingAction = nil
action()
}
pendingAction = nil
action?()
}
}
.onClose {
isShowAuthView = false
},
onClose: {
isShowAuthView = false
}
)
}
}
.sodaToast(isPresented: $viewModel.isShowPopup, message: viewModel.errorMessage, autohideIn: 2)
.authContentSettings(viewModel: mypageViewModel, onCancel: { pendingAction = nil })
}
}
+65 -16
View File
@@ -326,14 +326,6 @@ enum I18n {
pick(ko: "입력 중", en: "Typing", ja: "入力中")
}
static func quotaAdAction(chatCount: Int) -> String {
pick(
ko: "광고 / \(chatCount)채팅",
en: "Ad / \(chatCount) chats",
ja: "広告 / \(chatCount)チャット"
)
}
static func quotaChatCount(_ chatCount: Int) -> String {
pick(
ko: "\(chatCount)채팅",
@@ -342,14 +334,6 @@ enum I18n {
)
}
static var rewardedAdLoadFailed: String {
pick(
ko: "광고를 불러오지 못했어요\n잠시 후 다시 시도해 주세요.",
en: "Could not load the ad.\nPlease try again later.",
ja: "広告を読み込めませんでした。\nしばらくしてからもう一度お試しください。"
)
}
static var backgroundSelectionTitle: String {
pick(ko: "배경 이미지 선택", en: "Select background image", ja: "背景画像を選択")
}
@@ -1653,6 +1637,66 @@ enum I18n {
}
enum Content {
static var authSensitiveContentOnDescription: String {
pick(
ko: "본인인증 완료 후 민감한 콘텐츠를 볼 수 있어요",
en: "You can view sensitive content after identity verification.",
ja: "本人認証完了後、センシティブなコンテンツを表示できます"
)
}
static var authSensitiveContentOffDescription: String {
pick(
ko: "민감한 콘텐츠가 목록과 검색에 노출되지 않아요",
en: "Sensitive content will not appear in lists or search.",
ja: "センシティブなコンテンツは一覧や検索に表示されません"
)
}
static var authExitTitle: String {
pick(ko: "본인인증 종료", en: "End identity verification", ja: "本人認証の終了")
}
static var authExitMessage: String {
pick(
ko: "본인인증을 종료하시겠어요?\n종료하면 다시 본인인증을 진행해야 해요.",
en: "Do you want to end identity verification?\nIf you end it, you’ll need to verify your identity again.",
ja: "本人認証を終了しますか?\n終了すると、もう一度本人認証を行う必要があります。"
)
}
static var authExitConfirm: String {
pick(ko: "종료하기", en: "End verification", ja: "終了する")
}
static var authExitCancel: String {
pick(ko: "계속하기", en: "Continue", ja: "続ける")
}
static var preferredContent: String {
pick(ko: "선호 콘텐츠", en: "Preferred content", ja: "好みのコンテンツ")
}
static var authSettingsGuide: String {
pick(
ko: "마이 > 설정 > 콘텐츠 보기 설정에서 언제든 바꿀 수 있어요",
en: "You can change this anytime in My > Settings > Content view settings.",
ja: "マイ > 設定 > コンテンツ表示設定でいつでも変更できます"
)
}
static var confirmAuthSettings: String {
pick(ko: "설정 완료", en: "Confirm settings", ja: "設定を完了")
}
static var selectedPreference: String {
pick(ko: "선택됨", en: "Selected", ja: "選択済み")
}
static var unselectedPreference: String {
pick(ko: "선택 안 됨", en: "Not selected", ja: "未選択")
}
static var sensitiveContentTitle: String {
pick(ko: "민감한 콘텐츠 보기", en: "Show sensitive content", ja: "センシティブなコンテンツ表示")
}
@@ -3508,6 +3552,7 @@ If you block this user, the following features will be restricted.
static var talk: String { pick(ko: "대화하기", en: "Start chat", ja: "トークする") }
static var dm: String { pick(ko: "DM 보내기", en: "Send DM", ja: "DMを送る") }
static var checkDm: String { pick(ko: "DM 확인하기", en: "Check DM", ja: "DMを確認") }
static var sendGift: String { pick(ko: "선물 보내기", en: "Send gift", ja: "ギフトを送る") }
static var uploadCommunityPost: String { pick(ko: "커뮤니티 글 올리기", en: "Upload community post", ja: "コミュニティ投稿") }
static var uploadAudioContent: String { pick(ko: "오디오 콘텐츠 올리기", en: "Upload audio content", ja: "オーディオコンテンツを投稿") }
static var createLive: String { pick(ko: "라이브 만들기", en: "Create live", ja: "ライブを作成") }
@@ -4872,6 +4917,10 @@ If you block this user, the following features will be restricted.
pick(ko: "보관함", en: "Library", ja: "ライブラリ")
}
static var giftBox: String {
pick(ko: "선물함", en: "Gift box", ja: "ギフトボックス")
}
static var blockList: String {
pick(ko: "차단목록", en: "Blocked list", ja: "ブロックリスト")
}
@@ -96,7 +96,7 @@ private struct SectionEventBannerPage: View {
.onTapGesture {
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
if let _ = item.detailImageUrl {
AppState.shared.setAppStep(step: .eventDetail(event: item))
AppState.shared.setAppStep(step: .eventDetail(eventId: item.id))
} else if let link = item.link,
link.trimmingCharacters(in: .whitespaces).count > 0,
let url = URL(string: link),
-2
View File
@@ -91,8 +91,6 @@ struct LiveView: View {
SectionLatestFinishedLiveView(items: viewModel.latestFinishedLiveItems)
}
YandexInlineBannerView(placement: .liveTab)
.padding(.vertical, -24)
if viewModel.replayLiveItems.count > 0 {
LiveReplayListView(contentList: viewModel.replayLiveItems)
@@ -8,7 +8,6 @@
import SwiftUI
import RefreshableScrollView
import Bootpay
import BootpayUI
struct LiveNowAllView: View {
@@ -126,35 +125,33 @@ struct LiveNowAllView: View {
viewModel.getLiveNowList()
}
.fullScreenCover(isPresented: $isShowAuthView) {
BootpayUI(payload: payload, requestType: BootpayRequest.TYPE_AUTHENTICATION)
.onConfirm { _ in
true
}
.onCancel { _ in
.fullScreenCover(isPresented: $isShowAuthView, onDismiss: mypageViewModel.presentAuthContentSettings) {
AuthVerificationView(
payload: payload,
onCancel: {
isShowAuthView = false
}
.onError { _ in
},
onError: {
AppState.shared.errorMessage = I18n.Main.Auth.authenticationError
AppState.shared.isShowErrorPopup = true
isShowAuthView = false
}
.onDone {
DEBUG_LOG("onDone: \($0)")
},
onDone: {
let action = pendingAction
mypageViewModel.authVerify($0) {
auth = true
isShowAuthView = false
if let action = pendingAction {
pendingAction = nil
action()
}
pendingAction = nil
action?()
}
}
.onClose {
isShowAuthView = false
},
onClose: {
isShowAuthView = false
}
)
}
.sodaToast(isPresented: $viewModel.isShowPopup, message: viewModel.errorMessage, autohideIn: 2)
.authContentSettings(viewModel: mypageViewModel, onCancel: { pendingAction = nil })
}
private func handleLiveNowItemTap(roomId: Int, isAdult: Bool) {
@@ -129,9 +129,6 @@ struct LiveDetailView: View {
.frame(width: proxy.size.width - 26.7)
}
YandexInlineBannerView(placement: .liveDetail, horizontalPadding: 0)
.frame(width: proxy.size.width - 26.7)
.padding(.top, 13.3)
Rectangle()
.frame(height: 1)
@@ -31,7 +31,7 @@ struct EventPopupDialogView: View {
.shared
.setAppStep(
step: .eventDetail(
event: eventPopup
eventId: eventPopup.id
)
)
AppState.shared.eventPopup = nil
+16 -19
View File
@@ -10,7 +10,6 @@ import SwiftUI
import Firebase
import Kingfisher
import Bootpay
import BootpayUI
struct HomeView: View {
@StateObject var viewModel = HomeViewModel()
@@ -296,33 +295,30 @@ struct HomeView: View {
}
}
.edgesIgnoringSafeArea(.bottom)
.fullScreenCover(isPresented: $isShowAuthView) {
BootpayUI(payload: payload, requestType: BootpayRequest.TYPE_AUTHENTICATION)
.onConfirm { _ in
true
}
.onCancel { _ in
.fullScreenCover(isPresented: $isShowAuthView, onDismiss: mypageViewModel.presentAuthContentSettings) {
AuthVerificationView(
payload: payload,
onCancel: {
isShowAuthView = false
}
.onError { _ in
},
onError: {
AppState.shared.errorMessage = I18n.Main.Auth.authenticationError
AppState.shared.isShowErrorPopup = true
isShowAuthView = false
}
.onDone {
DEBUG_LOG("onDone: \($0)")
},
onDone: {
let action = pendingAction
mypageViewModel.authVerify($0) {
auth = true
isShowAuthView = false
if let action = pendingAction {
pendingAction = nil
action()
}
pendingAction = nil
action?()
}
}
.onClose {
isShowAuthView = false
},
onClose: {
isShowAuthView = false
}
)
}
.valueChanged(value: appState.pushRoomId) { value in
guard value > 0 else {
@@ -463,6 +459,7 @@ struct HomeView: View {
autohideIn: 2
)
}
.authContentSettings(viewModel: mypageViewModel, onCancel: { pendingAction = nil })
}
private func handleLiveNowItemTap(roomId: Int, isAdult: Bool) {
@@ -13,8 +13,18 @@ import Moya
final class AuthRepository {
private let api = MoyaProvider<AuthApi>()
func authCertificate(receiptId: String) -> AnyPublisher<Response, MoyaError> {
return api.requestPublisher(.auth(request: AuthVerifyRequest(receiptId: receiptId)))
func authCertificate(request: AuthVerifyRequest) -> AnyPublisher<Response, MoyaError> {
#if AUTH_VERIFICATION_MOCK
let requestToken = UserDefaults.string(forKey: .token)
guard let data = AuthVerificationMock.shared.confirm(request: request, requestToken: requestToken) else {
return Fail(error: MoyaError.statusCode(Response(statusCode: 401, data: Data())))
.eraseToAnyPublisher()
}
return Just(Response(statusCode: 200, data: data))
.setFailureType(to: MoyaError.self)
.eraseToAnyPublisher()
#else
return api.requestPublisher(.auth(request: request))
#endif
}
}
@@ -9,8 +9,12 @@ import Foundation
struct AuthVerifyRequest: Encodable {
let receiptId: String
let isAdultContentVisible: Bool
let contentType: ContentType
enum CodingKeys : String, CodingKey {
case receiptId = "receipt_id"
case isAdultContentVisible
case contentType
}
}
+100 -46
View File
@@ -8,7 +8,6 @@
import SwiftUI
import Bootpay
import BootpayUI
import Kingfisher
import RefreshableScrollView
@@ -33,28 +32,23 @@ struct MyPageView: View {
BaseView(isLoading: $viewModel.isLoading) {
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty &&
viewModel.isShowAuthView {
BootpayUI(payload: payload, requestType: BootpayRequest.TYPE_AUTHENTICATION)
.onConfirm {
DEBUG_LOG("onConfirm: \($0)")
return true
}
.onCancel {
DEBUG_LOG("onCancel: \($0)")
}
.onError {
DEBUG_LOG("onError: \($0)")
AuthVerificationView(
payload: payload,
onCancel: {},
onError: {
viewModel.errorMessage = I18n.Main.Auth.authenticationError
viewModel.isShowPopup = true
viewModel.isShowAuthView = false
}
.onDone {
DEBUG_LOG("onDone: \($0)")
},
onDone: {
viewModel.authVerify($0)
}
.onClose {
DEBUG_LOG("onClose")
viewModel.isShowAuthView = false
viewModel.presentAuthContentSettings()
},
onClose: {
viewModel.isShowAuthView = false
}
)
} else {
VStack(spacing: 0) {
// Header
@@ -62,9 +56,9 @@ struct MyPageView: View {
isShowButton: !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty
)
if let notice = viewModel.latestNotice {
if !viewModel.latestNotices.isEmpty {
// Update Banner
UpdateBannerView(item: notice)
UpdateBannerView(items: viewModel.latestNotices)
}
ScrollView(.vertical, showsIndicators: false) {
@@ -136,7 +130,7 @@ struct MyPageView: View {
.padding(.horizontal, 24)
}
if let url = URL(string: "https://bit.ly/4h7pVks"),
if let url = URL(string: "https://forms.gle/5uBThHCf2iM84Vgp6"),
UIApplication.shared.canOpenURL(url) {
// SodaLive Banner
Image(locale.identifier.hasPrefix("ja") ? "img_apply_creator_ja" : "img_apply_creator")
@@ -149,7 +143,7 @@ struct MyPageView: View {
}
}
if let url = URL(string: "https://blog.naver.com/sodalive_official"),
if let url = URL(string: "https://www.sodalive.net/services"),
UIApplication.shared.canOpenURL(url) {
// SodaLive Banner
Image(locale.identifier.hasPrefix("ja") ? "img_introduce_sodalive_ja" : "img_introduce_sodalive")
@@ -176,11 +170,11 @@ struct MyPageView: View {
viewModel.getMypage()
recentContentViewModel.fetchRecentContents()
}
viewModel.getLatestNotice()
viewModel.getLatestNotices()
}
}
}
.sodaToast(isPresented: $viewModel.isShowPopup, message: viewModel.errorMessage, autohideIn: 2)
.authContentSettings(viewModel: viewModel)
.onAppear {
payload.applicationId = BOOTPAY_APP_ID
payload.price = 0
@@ -223,34 +217,88 @@ struct MyPageHeaderView: View {
// MARK: - Update Banner View
struct UpdateBannerView: View {
let item: NoticeItem
private static let foregroundColor = Color(hex: "B0BEC5")
private static let rollInterval: TimeInterval = 5
private static let transitionDuration: TimeInterval = 0.35
let items: [NoticeItem]
@Environment(\.scenePhase) private var scenePhase
@Environment(\.accessibilityReduceMotion) private var reduceMotion
@State private var roller = MyPageNoticeRoller()
@State private var rollTimer: Timer?
@State private var isVisible = false
var body: some View {
HStack {
Text("\(item.title)")
.appFont(size: 16)
.foregroundColor(Color(hex: "B0BEC5"))
Spacer()
HStack(spacing: 2) {
Text(I18n.MyPage.Main.detail)
.appFont(size: 16)
.foregroundColor(Color(hex: "B0BEC5"))
Image(systemName: "chevron.right")
.foregroundColor(Color(hex: "B0BEC5"))
.frame(width: 24, height: 24)
ZStack {
if let item = roller.current {
Button {
AppState.shared.setAppStep(step: .noticeDetail(notice: item))
} label: {
HStack(spacing: SodaSpacing.s8) {
ZStack {
Text(item.title)
.appFont(.body3)
.lineLimit(1)
.truncationMode(.tail)
.frame(maxWidth: .infinity, alignment: .leading)
.id(roller.index)
.transition(reduceMotion ? .identity : .asymmetric(
insertion: .move(edge: .bottom),
removal: .move(edge: .top)
))
}
.clipped()
Image(systemName: "chevron.right")
.frame(width: SodaSpacing.s24, height: SodaSpacing.s24)
.accessibilityHidden(true)
}
.foregroundColor(Self.foregroundColor)
.padding(.horizontal, SodaSpacing.s24)
.padding(.vertical, SodaSpacing.s6)
.contentShape(Rectangle())
}
.buttonStyle(.plain)
}
}
.padding(.horizontal, 24)
.padding(.vertical, 6)
.clipped()
.background(Color.black)
.contentShape(Rectangle())
.onTapGesture {
AppState.shared.setAppStep(step: .noticeDetail(notice: item))
.onAppear {
isVisible = true
roller.update(items)
restartRollTimer(scenePhase: scenePhase, reduceMotion: reduceMotion)
}
.onDisappear {
isVisible = false
stopRollTimer()
}
.onChange(of: items) { items in
roller.update(items)
restartRollTimer(scenePhase: scenePhase, reduceMotion: reduceMotion)
}
.onChange(of: scenePhase) { scenePhase in
restartRollTimer(scenePhase: scenePhase, reduceMotion: reduceMotion)
}
.onChange(of: reduceMotion) { reduceMotion in
restartRollTimer(scenePhase: scenePhase, reduceMotion: reduceMotion)
}
}
private func restartRollTimer(scenePhase: ScenePhase, reduceMotion: Bool) {
stopRollTimer()
guard roller.shouldRoll(isVisible: isVisible, isActive: scenePhase == .active) else { return }
rollTimer = Timer.scheduledTimer(withTimeInterval: Self.rollInterval, repeats: true) { _ in
withAnimation(reduceMotion ? nil : .easeOut(duration: Self.transitionDuration)) {
roller.advance()
}
}
}
private func stopRollTimer() {
rollTimer?.invalidate()
rollTimer = nil
}
}
@@ -401,6 +449,12 @@ struct CategoryButtonsView: View {
var body: some View {
LazyVGrid(columns: Array(repeating: GridItem(.flexible()), count: 4), spacing: 16) {
if isKoreanCountry && LanguageHeaderProvider.current == "ko" {
CategoryButtonItem(icon: "ic_my_present", title: I18n.MyPage.Category.giftBox) {
AppState.shared.setAppStep(step: .giftBoxList)
}
}
CategoryButtonItem(icon: "ic_my_storage", title: I18n.MyPage.Category.storage) {
AppState.shared.setAppStep(step: .myBox(currentTab: .orderlist))
}
+191 -57
View File
@@ -14,8 +14,11 @@ final class MyPageViewModel: ObservableObject {
private let authRepository = AuthRepository()
private let noticeRepository = NoticeRepository()
private var subscription = Set<AnyCancellable>()
private var pendingAuthReceiptId: String?
private var pendingAuthRequest: AuthVerifyRequest?
private var pendingAuthSuccess: (() -> Void)?
@Published var latestNotice: NoticeItem? = nil
@Published var latestNotices: [NoticeItem] = []
@Published var nickname: String = ""
@Published var profileUrl: String = ""
@@ -28,6 +31,16 @@ final class MyPageViewModel: ObservableObject {
@Published var isShowPopup = false
@Published var isLoading = false
@Published var isShowAuthView = false
@Published var isShowAuthContentSettings = false
@Published var authIsAdultContentVisible = true {
didSet {
if !authIsAdultContentVisible {
authContentType = .ALL
}
}
}
@Published var authContentType: ContentType = .ALL
@Published private(set) var isSubmittingAuth = false
func getMypage() {
isLoading = true
@@ -73,65 +86,182 @@ final class MyPageViewModel: ObservableObject {
}
func authVerify(_ data: [String: Any], onSuccess: (() -> Void)? = nil) {
isLoading = true
let _data = data["data"] as? [String: Any]
if let data = _data {
let receiptId = data["receipt_id"] as! String
authRepository.authCertificate(receiptId: receiptId)
.sink { result in
switch result {
case .finished:
DEBUG_LOG("finish")
case .failure(let error):
ERROR_LOG(error.localizedDescription)
}
} receiveValue: { [unowned self] response in
self.isLoading = false
let responseData = response.data
do {
let jsonDecoder = JSONDecoder()
let decoded = try jsonDecoder.decode(ApiResponse<AuthResponse>.self, from: responseData)
if let data = decoded.data, decoded.success {
if data.gender == 0 {
UserDefaults.set(ContentType.FEMALE.rawValue, forKey: .contentPreference)
} else {
UserDefaults.set(ContentType.MALE.rawValue, forKey: .contentPreference)
}
if let onSuccess = onSuccess {
onSuccess()
} else {
AppState.shared.isRestartApp = true
AppState.shared.setAppStep(step: .splash)
}
} else {
if let message = decoded.message {
self.errorMessage = message
} else {
self.errorMessage = I18n.MyPage.Auth.verificationErrorWithSupport
}
self.isShowPopup = true
}
} catch {
self.errorMessage = I18n.MyPage.Auth.verificationErrorWithSupport
self.isShowPopup = true
}
}
.store(in: &subscription)
} else {
isLoading = false
guard Thread.isMainThread else {
DispatchQueue.main.async { [weak self] in
self?.authVerify(data, onSuccess: onSuccess)
}
return
}
guard pendingAuthReceiptId == nil, !isSubmittingAuth else { return }
guard let payload = data["data"] as? [String: Any],
let receiptId = payload["receipt_id"] as? String,
!receiptId.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty else {
errorMessage = I18n.Main.Auth.authenticationError
isShowPopup = true
return
}
pendingAuthReceiptId = receiptId
pendingAuthSuccess = onSuccess
authIsAdultContentVisible = true
authContentType = .ALL
}
func presentAuthContentSettings() {
guard Thread.isMainThread else {
DispatchQueue.main.async { [weak self] in
self?.presentAuthContentSettings()
}
return
}
guard pendingAuthReceiptId != nil, !isSubmittingAuth else { return }
isShowAuthContentSettings = true
}
func cancelAuthContentSettings() {
guard Thread.isMainThread else {
DispatchQueue.main.async { [weak self] in
self?.cancelAuthContentSettings()
}
return
}
guard !isSubmittingAuth, isShowAuthContentSettings else { return }
clearPendingAuthVerification()
isShowPopup = false
}
func confirmAuthContentSettings() {
guard Thread.isMainThread else {
DispatchQueue.main.async { [weak self] in
self?.confirmAuthContentSettings()
}
return
}
guard let receiptId = pendingAuthReceiptId, !isSubmittingAuth else { return }
pendingAuthRequest = AuthVerifyRequest(
receiptId: receiptId,
isAdultContentVisible: authIsAdultContentVisible,
contentType: authIsAdultContentVisible ? authContentType : .ALL
)
isSubmittingAuth = true
isShowAuthContentSettings = false
}
func submitPendingAuthVerification() {
guard Thread.isMainThread else {
DispatchQueue.main.async { [weak self] in
self?.submitPendingAuthVerification()
}
return
}
guard isSubmittingAuth, let request = pendingAuthRequest else { return }
pendingAuthRequest = nil
authRepository.authCertificate(request: request)
.receive(on: DispatchQueue.main)
.sink { [weak self] result in
if case .failure = result {
self?.handleAuthSubmissionFailure()
}
} receiveValue: { [weak self] response in
guard let self = self else { return }
guard (200..<300).contains(response.statusCode) else {
self.handleAuthSubmissionFailure()
return
}
do {
let decoded = try JSONDecoder().decode(ApiResponse<AuthResponse>.self, from: response.data)
guard decoded.success, decoded.data != nil else {
self.handleAuthSubmissionFailure()
return
}
if self.pendingAuthSuccess != nil {
self.synchronizeAuthenticatedMember()
} else {
UserDefaults.set(request.isAdultContentVisible, forKey: .isAdultContentVisible)
UserDefaults.set(request.contentType.rawValue, forKey: .contentPreference)
self.restartAfterAuthVerification()
}
} catch {
self.handleAuthSubmissionFailure()
}
}
.store(in: &subscription)
}
private func handleAuthSubmissionFailure() {
pendingAuthRequest = nil
isSubmittingAuth = false
errorMessage = I18n.MyPage.Auth.verificationErrorWithSupport
isShowPopup = true
isShowAuthContentSettings = true
}
private func synchronizeAuthenticatedMember() {
repository.getMemberInfo()
.receive(on: DispatchQueue.main)
.sink { [weak self] result in
if case .failure = result {
self?.restartAfterAuthVerification()
}
} receiveValue: { [weak self] response in
guard let self = self else { return }
guard (200..<300).contains(response.statusCode) else {
self.restartAfterAuthVerification()
return
}
do {
let decoded = try JSONDecoder().decode(ApiResponse<GetMemberInfoResponse>.self, from: response.data)
guard let data = decoded.data, decoded.success, data.isAuth else {
self.restartAfterAuthVerification()
return
}
UserDefaults.set(data.can, forKey: .can)
UserDefaults.set(data.point, forKey: .point)
UserDefaults.set(data.isAuth, forKey: .auth)
UserDefaults.set(data.role.rawValue, forKey: .role)
UserDefaults.set(data.auditionNotice ?? false, forKey: .isAuditionNotification)
UserDefaults.set(data.countryCode, forKey: .countryCode)
UserDefaults.set(data.isAdultContentVisible, forKey: .isAdultContentVisible)
UserDefaults.set(data.isAdultContentVisible ? data.contentType : ContentType.ALL.rawValue, forKey: .contentPreference)
self.isAuth = data.isAuth
let onSuccess = self.pendingAuthSuccess
self.clearPendingAuthVerification()
onSuccess?()
} catch {
self.restartAfterAuthVerification()
}
}
.store(in: &subscription)
}
private func clearPendingAuthVerification() {
pendingAuthReceiptId = nil
pendingAuthRequest = nil
pendingAuthSuccess = nil
isSubmittingAuth = false
isShowAuthContentSettings = false
}
private func restartAfterAuthVerification() {
clearPendingAuthVerification()
AppState.shared.isRestartApp = true
AppState.shared.setAppStep(step: .splash)
}
func getLatestNotice() {
noticeRepository.getLatestNotice()
func getLatestNotices() {
noticeRepository.getLatestNotices()
.receive(on: DispatchQueue.main)
.sink { result in
switch result {
case .finished:
@@ -141,14 +271,18 @@ final class MyPageViewModel: ObservableObject {
}
} receiveValue: {[unowned self] response in
self.isLoading = false
guard (200..<300).contains(response.statusCode) else {
ERROR_LOG("Latest notices HTTP \(response.statusCode)")
return
}
let responseData = response.data
do {
let jsonDecoder = JSONDecoder()
let decoded = try jsonDecoder.decode(ApiResponse<NoticeItem>.self, from: responseData)
let decoded = try jsonDecoder.decode(ApiResponse<[NoticeItem]>.self, from: responseData)
if let data = decoded.data, decoded.success {
self.latestNotice = data
self.latestNotices = data
}
} catch {
ERROR_LOG(error.localizedDescription)
@@ -7,6 +7,12 @@
import SwiftUI
enum ServiceCenterInquiry {
static func openTalk() {
UIApplication.shared.open(URL(string: "http://pf.kakao.com/_lkxgxhG/chat")!)
}
}
struct ServiceCenterView: View {
@ObservedObject var viewModel = ServiceCenterViewModel()
@@ -45,7 +51,7 @@ struct ServiceCenterView: View {
.padding(.horizontal, 13.3)
.padding(.top, 20)
.onTapGesture {
UIApplication.shared.open(URL(string: "http://pf.kakao.com/_lkxgxhG/chat")!)
ServiceCenterInquiry.openTalk()
}
Rectangle()
@@ -17,7 +17,6 @@ struct PushNotificationListView: View {
selectedTheme: $viewModel.selectedCategory
)
YandexInlineBannerView(placement: .pushNotificationList)
ScrollView(.vertical, showsIndicators: false) {
LazyVStack(spacing: 0) {
@@ -11,6 +11,7 @@ import Moya
enum EventApi {
case getEvents
case getEventPopup
case getEventDetail(id: Int)
}
extension EventApi: TargetType {
@@ -25,24 +26,30 @@ extension EventApi: TargetType {
case .getEventPopup:
return "/event/popup"
case .getEventDetail(let id):
return "/api/v2/events/\(id)"
}
}
var method: Moya.Method {
switch self {
case .getEvents, .getEventPopup:
case .getEvents, .getEventPopup, .getEventDetail:
return .get
}
}
var task: Task {
switch self {
case .getEvents, .getEventPopup:
case .getEvents, .getEventPopup, .getEventDetail:
return .requestPlain
}
}
var headers: [String : String]? {
if case .getEventDetail = self, UserDefaults.string(forKey: .token).isEmpty {
return nil
}
return ["Authorization": "Bearer \(UserDefaults.string(forKey: UserDefaultsKey.token))"]
}
}
@@ -9,38 +9,50 @@ import SwiftUI
import Kingfisher
struct EventDetailView: View {
let event: EventItem
@Environment(\.dismiss) private var dismiss
@StateObject private var viewModel: EventDetailViewModel
init(eventId: Int) {
_viewModel = StateObject(wrappedValue: EventDetailViewModel(eventId: eventId))
}
var body: some View {
BaseView {
BaseView(isLoading: $viewModel.isLoading) {
GeometryReader { proxy in
VStack(spacing: 0) {
DetailNavigationBar(title: I18n.Settings.Event.detailTitle)
DetailNavigationBar(title: I18n.Settings.Event.detailTitle, backAction: {
viewModel.cancel()
dismiss()
})
ScrollView(.vertical, showsIndicators: false) {
KFImage(URL(string: event.detailImageUrl!))
.cancelOnDisappear(true)
.resizable()
.scaledToFit()
if case .loaded(let event) = viewModel.state,
let detailImageUrl = event.detailImageUrl {
KFImage(URL(string: detailImageUrl))
.cancelOnDisappear(true)
.resizable()
.scaledToFit()
}
}
Spacer()
if let link = event.link, link.count > 0, let url = URL(string: link), UIApplication.shared.canOpenURL(url) {
Text(I18n.Settings.Event.participateButton)
.appFont(size: 18.3, weight: .bold)
.foregroundColor(.white)
.padding(.vertical, 16)
.frame(width: screenSize().width - 26.7)
.background(Color(hex: "3e737c"))
.cornerRadius(10)
.padding(13.3)
.background(Color(hex: "222222"))
.cornerRadius(16.7, corners: [.topLeft, .topRight])
.onTapGesture {
UIApplication.shared.open(url)
}
if let url = viewModel.participationURL, UIApplication.shared.canOpenURL(url) {
Button {
UIApplication.shared.open(url)
} label: {
Text(I18n.Settings.Event.participateButton)
.appFont(size: 18.3, weight: .bold)
.foregroundColor(.white)
.padding(.vertical, 16)
.frame(width: screenSize().width - 26.7)
.background(Color.soda400)
.cornerRadius(10)
.padding(13.3)
.background(Color(hex: "222222"))
.cornerRadius(16.7, corners: [.topLeft, .topRight])
}
.buttonStyle(.plain)
}
if proxy.safeAreaInsets.bottom > 0 {
@@ -52,19 +64,23 @@ struct EventDetailView: View {
.edgesIgnoringSafeArea(.bottom)
}
}
.sodaToast(isPresented: $viewModel.isShowPopup, message: viewModel.errorMessage, autohideIn: 2)
.onAppear {
viewModel.load()
}
.onDisappear {
viewModel.cancel()
}
.onReceive(viewModel.$state) { state in
if state == .unavailable, viewModel.takeUnavailableDismissal() {
dismiss()
}
}
}
}
struct EventDetailView_Previews: PreviewProvider {
static var previews: some View {
EventDetailView(
event: EventItem(
id: 1,
thumbnailImageUrl: "",
detailImageUrl: "",
popupImageUrl: "",
link: "http://m.naver.com"
)
)
EventDetailView(eventId: 0)
}
}
@@ -30,15 +30,14 @@ struct EventListView: View {
)
)
.resizable()
.scaledToFill()
.scaledToFit()
.frame(
width: screenSize().width - 26.7,
height: (screenSize().width - 26.7) * 300 / 1000
width: screenSize().width - 26.7
)
.contentShape(Rectangle())
.onTapGesture {
if let _ = event.detailImageUrl {
AppState.shared.setAppStep(step: .eventDetail(event: event))
AppState.shared.setAppStep(step: .eventDetail(eventId: event.id))
} else if let link = event.link, link.trimmingCharacters(in: .whitespaces).count > 0, let url = URL(string: link), UIApplication.shared.canOpenURL(url) {
UIApplication.shared.open(url)
}
@@ -20,5 +20,8 @@ final class EventRepository {
func getEventPopup() -> AnyPublisher<Response, MoyaError> {
return api.requestPublisher(.getEventPopup)
}
}
func getEventDetail(id: Int) -> AnyPublisher<Response, MoyaError> {
return api.requestPublisher(.getEventDetail(id: id))
}
}
@@ -10,7 +10,7 @@ import Moya
enum NoticeApi {
case getNotices
case getLatestNotice
case getLatestNotices
}
extension NoticeApi: TargetType {
@@ -23,8 +23,8 @@ extension NoticeApi: TargetType {
case .getNotices:
return "/notice"
case .getLatestNotice:
return "/notice/latest"
case .getLatestNotices:
return "/api/v2/notices/latest"
}
}
@@ -38,15 +38,17 @@ extension NoticeApi: TargetType {
let parameters = ["timezone": TimeZone.current.identifier] as [String: Any]
return .requestParameters(parameters: parameters, encoding: URLEncoding.queryString)
case .getLatestNotice:
case .getLatestNotices:
return .requestPlain
}
}
var headers: [String : String]? {
switch self {
default:
case .getNotices:
return ["Authorization": "Bearer \(UserDefaults.string(forKey: UserDefaultsKey.token))"]
case .getLatestNotices:
return nil
}
}
}
@@ -18,8 +18,7 @@ final class NoticeRepository {
return api.requestPublisher(.getNotices)
}
func getLatestNotice() -> AnyPublisher<Response, MoyaError> {
return api.requestPublisher(.getLatestNotice)
func getLatestNotices() -> AnyPublisher<Response, MoyaError> {
return api.requestPublisher(.getLatestNotices)
}
}
@@ -158,8 +158,6 @@ struct NotificationReceiveSettingsView: View {
.padding(.top, 13.3)
.padding(.horizontal, 13.3)
YandexInlineBannerView(placement: .notificationReceiveSettings)
.padding(.top, 26.7)
Text(I18n.Settings.Notification.followingChannels)
.appFont(size: 16.7, weight: .bold)
@@ -36,7 +36,7 @@ class FirebaseTracking {
let utmCampaign = AppState.shared.marketingUtmCampaign.trimmingCharacters(in: .whitespacesAndNewlines)
if !utmSource.isEmpty && !utmMedium.isEmpty && !utmCampaign.isEmpty {
Analytics.logEvent("ad_partner_campaign_details", parameters: [
Analytics.logEvent(AnalyticsEventCampaignDetails, parameters: [
AnalyticsParameterSource: utmSource,
AnalyticsParameterMedium: utmMedium,
AnalyticsParameterCampaign: utmCampaign
@@ -46,19 +46,45 @@ final class UserRepository {
}
func getMypage() -> AnyPublisher<Response, MoyaError> {
#if AUTH_VERIFICATION_MOCK
return selfMemberPublisher(.getMypage, as: MyPageResponse.self)
#else
return api.requestPublisher(.getMypage)
#endif
}
func getMemberInfo() -> AnyPublisher<Response, MoyaError> {
#if AUTH_VERIFICATION_MOCK
return selfMemberPublisher(.getMemberInfo, as: GetMemberInfoResponse.self)
#else
return api.requestPublisher(.getMemberInfo)
#endif
}
func updateContentPreference(request: UpdateContentPreferenceRequest) -> AnyPublisher<Response, MoyaError> {
#if AUTH_VERIFICATION_MOCK
let requestToken = UserDefaults.string(forKey: .token)
let session = AuthVerificationMock.shared.session(for: requestToken)
return api.requestPublisher(.updateContentPreference(request: request))
.map { response in
AuthVerificationMock.shared.updateContentPreference(from: response.data,
statusCode: response.statusCode,
requestToken: requestToken,
session: session)
return response
}
.eraseToAnyPublisher()
#else
return api.requestPublisher(.updateContentPreference(request: request))
#endif
}
func getMemberCan() -> AnyPublisher<Response, MoyaError> {
#if AUTH_VERIFICATION_MOCK
return getMemberInfo()
#else
return api.requestPublisher(.getMemberInfo)
#endif
}
func updateNotificationSettings(live: Bool? = nil, uploadContent: Bool? = nil, message: Bool? = nil, audition: Bool? = nil) -> AnyPublisher<Response, MoyaError> {
@@ -149,4 +175,23 @@ final class UserRepository {
func getMemberProfile(memberId: Int) -> AnyPublisher<Response, MoyaError> {
return api.requestPublisher(.getMemberProfile(memberId: memberId))
}
#if AUTH_VERIFICATION_MOCK
private func selfMemberPublisher<Member: Decodable>(_ target: UserApi, as type: Member.Type) -> AnyPublisher<Response, MoyaError> {
let requestToken = UserDefaults.string(forKey: .token)
let session = AuthVerificationMock.shared.session(for: requestToken)
return api.requestPublisher(target)
.map { response in
let data = AuthVerificationMock.shared.overlayMemberResponse(response.data,
statusCode: response.statusCode,
requestToken: requestToken,
session: session,
as: type)
guard data != response.data else { return response }
return Response(statusCode: response.statusCode, data: data,
request: response.request, response: response.response)
}
.eraseToAnyPublisher()
}
#endif
}
-16
View File
@@ -11,7 +11,6 @@ let BASE_URL = "https://api.sodalive.net"
let APPLY_SODALIVE_CREATOR = "https://forms.gle/mmhJKmijjVRnwtdZ7"
let AGORA_APP_ID = "e34e40046e9847baba3adfe2b8ffb4f6"
let AGORA_APP_CERTIFICATE = "15cadeea4ba94ff7b091c9a10f4bf4a6"
let BOOTPAY_APP_ID = "64c35be1d25985001dc50c88"
let BOOTPAY_APP_HECTO_ID = "664c1707b18b225deca4b42a"
@@ -32,18 +31,3 @@ let LINE_CHANNEL_ID = "2008995539"
let AGORA_CUSTOMER_ID = "de5dd9ea151f4a43ba1ad8411817b169"
let AGORA_CUSTOMER_SECRET = "3855da8bc5ae4743af8bf4f87408b515"
let YANDEX_LIVE_TAB_BANNER_AD_UNIT_ID = "R-M-19157621-1"
let YANDEX_LIVE_DETAIL_BANNER_AD_UNIT_ID = "R-M-19157621-2"
let YANDEX_CONTENT_DETAIL_BANNER_AD_UNIT_ID = "R-M-19157621-3"
let YANDEX_CONTENT_DETAIL_INTERSTITIAL_AD_UNIT_ID = "R-M-19157621-4"
let YANDEX_CREATOR_COMMUNITY_ALL_BANNER_AD_UNIT_ID = "R-M-19157621-5"
let YANDEX_SERIES_MAIN_HOME_BANNER_AD_UNIT_ID = "R-M-19157621-6"
let YANDEX_SERIES_MAIN_DAY_OF_WEEK_BANNER_AD_UNIT_ID = "R-M-19157621-7"
let YANDEX_SERIES_MAIN_BY_GENRE_BANNER_AD_UNIT_ID = "R-M-19157621-8"
let YANDEX_PUSH_NOTIFICATION_LIST_BANNER_AD_UNIT_ID = "R-M-19157621-9"
let YANDEX_NOTIFICATION_RECEIVE_SETTINGS_BANNER_AD_UNIT_ID = "R-M-19157621-10"
let YANDEX_CHAT_CHARACTER_LIST_BANNER_AD_UNIT_ID = "R-M-19157621-11"
let YANDEX_CHAT_ORIGINAL_TAB_TOP_BANNER_AD_UNIT_ID = "R-M-19157621-12"
let YANDEX_CHAT_TALK_TAB_TOP_BANNER_AD_UNIT_ID = "R-M-19157621-13"
let YANDEX_CHAT_ROOM_QUOTA_REWARDED_AD_UNIT_ID = "R-M-19157621-14"
@@ -0,0 +1,86 @@
#if AUTH_VERIFICATION_MOCK
import Foundation
final class AuthVerificationMock {
static let shared = AuthVerificationMock()
final class Session {
fileprivate let token: String
fileprivate var preference: (isAdultContentVisible: Bool, contentType: ContentType)?
fileprivate init(token: String) {
self.token = token
}
}
private let lock = NSLock()
private var loginSession: Session?
private init() {}
func confirm(request: AuthVerifyRequest, requestToken: String) -> Data? {
lock.lock()
defer { lock.unlock() }
guard let session = currentSession(for: requestToken) else { return nil }
session.preference = (request.isAdultContentVisible, request.isAdultContentVisible ? request.contentType : .ALL)
return Data(#"{"success":true,"data":{"gender":0}}"#.utf8)
}
func session(for requestToken: String) -> Session? {
lock.lock()
defer { lock.unlock() }
return currentSession(for: requestToken)
}
func resetSession(_ changes: () -> Void) {
lock.lock()
defer { lock.unlock() }
loginSession = nil
changes()
}
func overlayMemberResponse<Member: Decodable>(_ data: Data, statusCode: Int, requestToken: String,
session: Session?, as type: Member.Type) -> Data {
lock.lock()
defer { lock.unlock() }
guard isActive(session, requestToken: requestToken), let preference = session?.preference,
(200..<300).contains(statusCode),
let decoded = try? JSONDecoder().decode(ApiResponse<Member>.self, from: data),
decoded.success, decoded.data != nil,
var envelope = (try? JSONSerialization.jsonObject(with: data)) as? [String: Any],
var member = envelope["data"] as? [String: Any] else { return data }
member["isAuth"] = true
member["isAdultContentVisible"] = preference.isAdultContentVisible
member["contentType"] = preference.contentType.rawValue
envelope["data"] = member
return (try? JSONSerialization.data(withJSONObject: envelope)) ?? data
}
func updateContentPreference(from data: Data, statusCode: Int, requestToken: String, session: Session?) {
lock.lock()
defer { lock.unlock() }
guard isActive(session, requestToken: requestToken), let session = session, session.preference != nil,
(200..<300).contains(statusCode),
let decoded = try? JSONDecoder().decode(ApiResponse<UpdateContentPreferenceResponse>.self, from: data),
decoded.success, let preference = decoded.data else { return }
session.preference = (preference.isAdultContentVisible, preference.isAdultContentVisible ? preference.contentType : .ALL)
}
private func currentSession(for requestToken: String) -> Session? {
guard !requestToken.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty,
requestToken == UserDefaults.string(forKey: .token) else { return nil }
if loginSession?.token != requestToken {
loginSession = Session(token: requestToken)
}
return loginSession
}
private func isActive(_ session: Session?, requestToken: String) -> Bool {
guard let session = session, session === loginSession else { return false }
return session.token == requestToken && requestToken == UserDefaults.string(forKey: .token)
}
}
#endif
@@ -0,0 +1,165 @@
import Foundation
import SwiftUI
import WebKit
struct KakaoPostcodeResult {
let zonecode: String
let address: String
init?(payload: Any) {
guard let values = payload as? [String: Any],
let zonecode = values["zonecode"] as? String,
let address = values["address"] as? String,
!zonecode.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty,
!address.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty else { return nil }
self.zonecode = zonecode
self.address = address
}
}
struct KakaoPostcodeSearchView: View {
let onSelect: (KakaoPostcodeResult) -> Void
@Environment(\.dismiss) private var dismiss
@State private var isLoading = true
@State private var hasFailed = false
var body: some View {
VStack(spacing: 0) {
HStack {
Text("우편번호 검색").appFont(.body2)
Spacer()
Button("닫기") { dismiss() }
.appFont(.body3)
.frame(minHeight: 44)
.accessibilityLabel("우편번호 검색 닫기")
}
.foregroundColor(.white)
.padding(.horizontal, SodaSpacing.s14)
ZStack {
KakaoPostcodeWebView(onSelect: onSelect) { failed in
hasFailed = failed
isLoading = false
}
.opacity(hasFailed ? 0 : 1)
.allowsHitTesting(!hasFailed)
.accessibilityHidden(hasFailed)
if hasFailed {
Text("주소 검색을 불러오지 못했습니다. 닫은 후 다시 시도해 주세요.")
.appFont(.body3)
.foregroundColor(.white)
.padding(SodaSpacing.s14)
} else if isLoading {
ProgressView("주소 검색을 불러오는 중")
.tint(.white)
.foregroundColor(.white)
.padding(SodaSpacing.s14)
.background(Color.gray900)
.cornerRadius(SodaRadius.r14)
}
}
}
.background(Color.black)
}
}
private struct KakaoPostcodeWebView: UIViewRepresentable {
let onSelect: (KakaoPostcodeResult) -> Void
let onLoad: (Bool) -> Void
private static let handlerName = "postcodeSelection"
func makeCoordinator() -> Coordinator {
Coordinator(onSelect: onSelect, onLoad: onLoad)
}
func makeUIView(context: Context) -> WKWebView {
let configuration = WKWebViewConfiguration()
configuration.userContentController.add(context.coordinator, name: Self.handlerName)
let webView = WKWebView(frame: .zero, configuration: configuration)
webView.navigationDelegate = context.coordinator
webView.loadHTMLString(Self.html, baseURL: URL(string: "https://postcode.map.kakao.com/"))
return webView
}
func updateUIView(_ uiView: WKWebView, context: Context) {}
static func dismantleUIView(_ uiView: WKWebView, coordinator: Coordinator) {
coordinator.isActive = false
uiView.stopLoading()
uiView.configuration.userContentController.removeScriptMessageHandler(forName: handlerName)
uiView.navigationDelegate = nil
uiView.uiDelegate = nil
}
private static let html = """
<!doctype html>
<html><head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>html,body,#postcode{margin:0;width:100%;height:100%;}</style>
<script src="https://t1.kakaocdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js"
onerror="document.documentElement.dataset.postcodeError='true'"></script>
</head><body><div id="postcode"></div>
<script>
try {
new kakao.Postcode({
width: '100%', height: '100%',
oncomplete: function(data) {
window.webkit.messageHandlers.postcodeSelection.postMessage({ zonecode: data.zonecode, address: data.address });
}
}).embed(document.getElementById('postcode'));
} catch (error) {
document.documentElement.dataset.postcodeError = 'true';
}
</script></body></html>
"""
final class Coordinator: NSObject, WKScriptMessageHandler, WKNavigationDelegate {
private let onSelect: (KakaoPostcodeResult) -> Void
private let onLoad: (Bool) -> Void
fileprivate var isActive = true
private var hasFailed = false
private var hasSelected = false
init(onSelect: @escaping (KakaoPostcodeResult) -> Void, onLoad: @escaping (Bool) -> Void) {
self.onSelect = onSelect
self.onLoad = onLoad
}
func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
guard isActive, !hasFailed, !hasSelected,
message.name == KakaoPostcodeWebView.handlerName,
message.frameInfo.isMainFrame,
let result = KakaoPostcodeResult(payload: message.body) else { return }
hasSelected = true
onSelect(result)
}
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
webView.evaluateJavaScript("document.documentElement.dataset.postcodeError === 'true'") { [weak self] value, error in
guard let self, self.isActive, !self.hasFailed else { return }
if error != nil || value as? Bool != false {
self.fail()
} else {
self.onLoad(false)
}
}
}
func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) {
fail()
}
func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) {
fail()
}
func webViewWebContentProcessDidTerminate(_ webView: WKWebView) {
fail()
}
private func fail() {
guard isActive else { return }
hasFailed = true
onLoad(true)
}
}
}
@@ -0,0 +1,77 @@
import SwiftUI
struct SodaAddressInputView: View {
@Binding var zipCode: String
@Binding var address: String
@Binding var addressDetail: String
@State private var isSearching = false
var body: some View {
VStack(alignment: .leading, spacing: SodaSpacing.s4) {
Text("우편번호")
.appFont(.body5)
.foregroundColor(.grayee)
VStack(spacing: SodaSpacing.s8) {
HStack(spacing: SodaSpacing.s8) {
readonlyField(zipCode, placeholder: "우편번호를 입력해 주세요", label: "우편번호")
Button {
isSearching = true
} label: {
Text("주소 검색")
.appFont(.body5)
.foregroundColor(.white)
.padding(.horizontal, SodaSpacing.s14)
.frame(minHeight: 44)
.overlay(Capsule().stroke(Color.gray500, lineWidth: 1))
.fixedSize(horizontal: true, vertical: false)
}
.buttonStyle(.plain)
.accessibilityLabel("주소 검색")
}
VStack(alignment: .leading, spacing: SodaSpacing.s4) {
Text("주소")
.appFont(.body5)
.foregroundColor(.grayee)
readonlyField(address, placeholder: "주소를 입력해 주세요", label: "기본 주소")
}
VStack(alignment: .leading, spacing: SodaSpacing.s4) {
Text("상세주소")
.appFont(.body5)
.foregroundColor(.grayee)
TextField("", text: $addressDetail, prompt: Text("상세 주소를 입력해 주세요").foregroundColor(.gray600))
.appFont(.body3)
.foregroundColor(.white)
.textContentType(.streetAddressLine2)
.autocorrectionDisabled()
.padding(SodaSpacing.s14)
.frame(maxWidth: .infinity, alignment: .leading)
.background(Color.gray900)
.cornerRadius(SodaRadius.r14)
.accessibilityLabel("상세 주소")
}
}
}
.sheet(isPresented: $isSearching) {
KakaoPostcodeSearchView { result in
if zipCode != result.zonecode || address != result.address {
addressDetail = ""
}
zipCode = result.zonecode
address = result.address
isSearching = false
}
}
}
private func readonlyField(_ value: String, placeholder: String, label: String) -> some View {
Text(value.isEmpty ? placeholder : value)
.appFont(.body3)
.foregroundColor(value.isEmpty ? .gray600 : .white)
.padding(SodaSpacing.s14)
.frame(maxWidth: .infinity, alignment: .leading)
.background(Color.gray900)
.cornerRadius(SodaRadius.r14)
.accessibilityLabel(label)
.accessibilityValue(value)
}
}
@@ -113,16 +113,16 @@ struct BannerCarousel: View {
HStack(alignment: .center, spacing: 1) {
Text(String(format: "%02d", currentPage))
.foregroundColor(.white)
.frame(width: 20)
Text("/")
.foregroundColor(.gray400)
Text(String(format: "%02d", items.count))
.foregroundColor(.gray400)
.frame(width: 20)
}
.appFont(.body3)
.lineLimit(1)
.fixedSize(horizontal: true, vertical: false)
.padding(.horizontal, SodaSpacing.s6)
.padding(.vertical, SodaSpacing.s4)
.background(Color.black.opacity(0.7))
@@ -0,0 +1,42 @@
import Foundation
struct SubBanner: Decodable, Hashable, Identifiable {
enum Placement: String, Decodable {
case homeRecommendation = "HOME_RECOMMENDATION"
case contentRecommendation = "CONTENT_RECOMMENDATION"
}
let id: Int
let placement: Placement
let imageUrl: String
let webUrl: String?
let androidDeepLink: String?
let iosDeepLink: String?
var imageURL: URL? { Self.webURL(imageUrl) }
var webURL: URL? { Self.webURL(webUrl) }
var iosURL: URL? {
guard let url = Self.absoluteURL(iosDeepLink),
let scheme = url.scheme?.lowercased(),
!["javascript", "data", "file", "content"].contains(scheme) else { return nil }
return url
}
var isEligible: Bool {
imageURL != nil && (iosURL != nil || webURL != nil)
}
private static func absoluteURL(_ raw: String?) -> URL? {
guard let raw, let url = URL(string: raw),
url.scheme != nil, url.absoluteString == raw else { return nil }
return url
}
private static func webURL(_ raw: String?) -> URL? {
guard let url = absoluteURL(raw),
let scheme = url.scheme?.lowercased(),
scheme == "http" || scheme == "https",
let host = url.host, !host.isEmpty else { return nil }
return url
}
}
@@ -0,0 +1,158 @@
import SwiftUI
import Kingfisher
struct SubBannerCarousel: View {
let items: [SubBanner]
let onTap: (SubBanner) -> Void
@Environment(\.scenePhase) private var scenePhase
@State private var displayIndex = 1
@State private var itemsRevision = 0
@State private var containerWidth: CGFloat = 0
@State private var imageRatios: [String: CGFloat] = [:]
@State private var lastKnownRatio: CGFloat?
@GestureState private var isSwiping = false
@GestureState private var dragOffset: CGFloat = 0
private static let autoScrollNanoseconds: UInt64 = 5_000_000_000
private static let transitionDuration: TimeInterval = 0.35
private var safeDisplayIndex: Int {
items.count > 1 ? min(max(displayIndex, 0), items.count + 1) : 0
}
private var safeIndex: Int {
items.count > 1 ? (safeDisplayIndex + items.count - 1) % items.count : 0
}
private var pages: [(id: String, item: SubBanner)] {
let originals = items.map { (id: "item-\($0.id)", item: $0) }
guard items.count > 1, let first = items.first, let last = items.last else { return originals }
return [(id: "leading-\(last.id)", item: last)] + originals + [(id: "trailing-\(first.id)", item: first)]
}
private var currentRatio: CGFloat? {
guard !items.isEmpty else { return nil }
return imageRatios[items[safeIndex].imageUrl]
}
private var height: CGFloat {
guard !items.isEmpty, let ratio = currentRatio ?? lastKnownRatio else { return 0 }
return containerWidth / ratio
}
var body: some View {
GeometryReader { geometry in
HStack(spacing: 0) {
ForEach(pages, id: \.id) { page in
Button {
onTap(page.item)
} label: {
KFImage(page.item.imageURL)
.placeholder { Color.gray800 }
.onSuccess { result in
let size = result.image.size
guard size.width > 0, size.height > 0 else { return }
imageRatios[page.item.imageUrl] = size.width / size.height
}
.startLoadingBeforeViewAppear()
.resizable()
.scaledToFit()
.frame(width: geometry.size.width, height: height)
.background(Color.gray800)
}
.buttonStyle(SubBannerTapStyle(drag: dragGesture(width: geometry.size.width)))
.accessibilityLabel(Text("\(safeIndex + 1) / \(items.count)"))
.accessibilityHidden(pages[safeDisplayIndex].id != page.id)
}
}
.offset(x: -CGFloat(safeDisplayIndex) * geometry.size.width + dragOffset)
.animation(.easeOut(duration: Self.transitionDuration), value: displayIndex)
.frame(width: geometry.size.width, height: height, alignment: .leading)
.contentShape(Rectangle())
.clipped()
.onAppear { containerWidth = geometry.size.width }
.onChange(of: geometry.size.width) { containerWidth = $0 }
}
.frame(height: height)
.onChange(of: currentRatio) { ratio in
if let ratio { lastKnownRatio = ratio }
}
.onChange(of: items) { _ in
itemsRevision += 1
normalize(to: items.count > 1 ? 1 : 0)
if items.isEmpty { lastKnownRatio = nil }
}
.onDisappear {
itemsRevision += 1
normalize(to: items.count > 1 ? safeIndex + 1 : 0)
}
.task(id: scenePhase == .active && items.count > 1 ? items : []) {
guard scenePhase == .active, items.count > 1 else { return }
while !Task.isCancelled {
do {
try await Task.sleep(nanoseconds: Self.autoScrollNanoseconds)
} catch {
return
}
guard !Task.isCancelled else { return }
if !isSwiping { move(by: 1) }
}
}
.accessibilityAdjustableAction { direction in
switch direction {
case .increment: move(by: 1)
case .decrement: move(by: -1)
@unknown default: break
}
}
}
private func dragGesture(width: CGFloat) -> some Gesture {
DragGesture(minimumDistance: SodaSpacing.s12, coordinateSpace: .global)
.updating($dragOffset) { value, offset, _ in
if items.count > 1, abs(value.translation.width) > abs(value.translation.height) {
offset = value.translation.width
}
}
.updating($isSwiping) { _, swiping, _ in swiping = true }
.onEnded { value in
guard abs(value.translation.width) > abs(value.translation.height) else { return }
if value.translation.width < -width * 0.2 {
move(by: 1)
} else if value.translation.width > width * 0.2 {
move(by: -1)
}
}
}
private func move(by step: Int) {
guard items.count > 1, (1...items.count).contains(displayIndex) else { return }
let next = displayIndex + step
displayIndex = next
guard next == 0 || next == items.count + 1 else { return }
let revision = itemsRevision
DispatchQueue.main.asyncAfter(deadline: .now() + Self.transitionDuration) {
guard itemsRevision == revision, displayIndex == next else { return }
normalize(to: next == 0 ? items.count : 1)
}
}
private func normalize(to index: Int) {
var transaction = Transaction()
transaction.disablesAnimations = true
withTransaction(transaction) { displayIndex = index }
}
}
private struct SubBannerTapStyle<Drag: Gesture>: PrimitiveButtonStyle {
let drag: Drag
func makeBody(configuration: Configuration) -> some View {
configuration.label
.contentShape(Rectangle())
.simultaneousGesture(drag.exclusively(before: TapGesture().onEnded { configuration.trigger() }))
.accessibilityAction { configuration.trigger() }
}
}
@@ -0,0 +1,28 @@
import Foundation
#if canImport(UIKit)
import UIKit
#endif
enum SubBannerLinkOpener {
static func open(_ banner: SubBanner, using opener: @escaping (URL, @escaping (Bool) -> Void) -> Void) {
let webURL = banner.webURL
if let iosURL = banner.iosURL {
opener(iosURL) { opened in
if !opened, let webURL {
opener(webURL) { _ in }
}
}
} else if let webURL {
opener(webURL) { _ in }
}
}
#if canImport(UIKit)
static func open(_ banner: SubBanner) {
open(banner) { url, completion in
UIApplication.shared.open(url, options: [:], completionHandler: completion)
}
}
#endif
}
@@ -0,0 +1,431 @@
import SwiftUI
private enum AuthContentSettingsLayout {
static let topInset: CGFloat = 26
static let headerHeight: CGFloat = 54
static let touchHeight: CGFloat = 44
static let buttonHeight: CGFloat = 52
static let titleLineHeight: CGFloat = 23
static let captionLineHeight: CGFloat = 17
static let radioSize: CGFloat = 22
static let radioDotSize: CGFloat = 12
static let radioRowGap: CGFloat = 1
static let radioBottomInset: CGFloat = 10
static let switchWidth: CGFloat = 44
static let switchHeight: CGFloat = 24
static let switchInset: CGFloat = 2
static let strokeWidth: CGFloat = 1
}
struct AuthContentSettingsSheet: View {
@Binding var isAdultContentVisible: Bool
@Binding var contentType: ContentType
let onConfirm: () -> Void
let onClose: () -> Void
var body: some View {
VStack(spacing: 0) {
header
ViewThatFits(in: .vertical) {
settingsContent
.fixedSize(horizontal: false, vertical: true)
ScrollView(.vertical, showsIndicators: false) {
settingsContent
}
.scrollBounceBehavior(.basedOnSize)
}
Button(action: onConfirm) {
Text(I18n.Settings.Content.confirmAuthSettings)
.appFont(size: SodaTypography.heading4.size, weight: .medium)
.foregroundColor(.white)
.frame(maxWidth: .infinity, minHeight: AuthContentSettingsLayout.buttonHeight)
.background(Color.soda400)
.clipShape(Capsule())
}
.buttonStyle(.plain)
.accessibilityIdentifier("authContentSettings.confirm")
.padding(.horizontal, SodaSpacing.s14)
.padding(.vertical, SodaSpacing.s8)
.fixedSize(horizontal: false, vertical: true)
}
.background(Color.gray900)
.accessibilityAction(.escape, onClose)
}
private var header: some View {
HStack(spacing: 0) {
Color.clear
.frame(width: AuthContentSettingsLayout.touchHeight, height: AuthContentSettingsLayout.touchHeight)
.accessibilityHidden(true)
Text(I18n.Settings.contentViewSettings)
.appFont(size: SodaTypography.heading4.size, weight: .medium)
.foregroundColor(.white)
.multilineTextAlignment(.center)
.frame(maxWidth: .infinity)
.fixedSize(horizontal: false, vertical: true)
.accessibilityAddTraits(.isHeader)
Button(action: onClose) {
Image(systemName: "xmark")
.font(.system(size: SodaTypography.body2.size, weight: .medium))
.foregroundColor(.gray400)
.frame(width: AuthContentSettingsLayout.touchHeight, height: AuthContentSettingsLayout.touchHeight)
.contentShape(Rectangle())
}
.buttonStyle(.borderless)
.accessibilityLabel(I18n.Settings.Content.authExitTitle)
.accessibilityIdentifier("authContentSettings.close")
}
.frame(minHeight: AuthContentSettingsLayout.headerHeight)
.padding(.top, AuthContentSettingsLayout.topInset)
.padding(.horizontal, SodaSpacing.s14)
.fixedSize(horizontal: false, vertical: true)
}
private var settingsContent: some View {
VStack(spacing: 0) {
sensitiveContentRow
.padding(.top, SodaSpacing.s8)
.padding(.bottom, isAdultContentVisible ? SodaSpacing.s14 : SodaSpacing.s8)
if isAdultContentVisible {
preferenceSection
}
HStack(alignment: .top, spacing: SodaSpacing.s6) {
Image(systemName: "info.circle")
.resizable()
.frame(width: SodaSpacing.s16, height: SodaSpacing.s16)
.accessibilityHidden(true)
Text(I18n.Settings.Content.authSettingsGuide)
.appFont(.caption3)
.frame(maxWidth: .infinity, minHeight: AuthContentSettingsLayout.captionLineHeight, alignment: .leading)
.fixedSize(horizontal: false, vertical: true)
}
.foregroundColor(.gray400)
.padding(.top, isAdultContentVisible ? 0 : SodaSpacing.s8)
.padding(.bottom, SodaSpacing.s20)
}
.padding(.horizontal, SodaSpacing.s14)
}
private var sensitiveContentRow: some View {
HStack(spacing: SodaSpacing.s12) {
VStack(alignment: .leading, spacing: SodaSpacing.s4) {
Text(I18n.Settings.Content.sensitiveContentTitle)
.appFont(.body2)
.fontWeight(.semibold)
.foregroundColor(.white)
.frame(minHeight: AuthContentSettingsLayout.titleLineHeight, alignment: .leading)
Text(isAdultContentVisible ? I18n.Settings.Content.authSensitiveContentOnDescription : I18n.Settings.Content.authSensitiveContentOffDescription)
.appFont(.caption3)
.foregroundColor(.gray400)
.frame(minHeight: AuthContentSettingsLayout.captionLineHeight, alignment: .leading)
.fixedSize(horizontal: false, vertical: true)
}
.frame(maxWidth: .infinity, alignment: .leading)
Toggle(I18n.Settings.Content.sensitiveContentTitle, isOn: $isAdultContentVisible)
.toggleStyle(AuthContentSettingsToggleStyle())
.accessibilityIdentifier("authContentSettings.toggle")
}
}
private var preferenceSection: some View {
VStack(alignment: .leading, spacing: 0) {
Rectangle()
.fill(Color.gray800)
.frame(height: AuthContentSettingsLayout.strokeWidth)
Text(I18n.Settings.Content.preferredContent)
.appFont(.caption2)
.foregroundColor(.gray400)
.frame(minHeight: AuthContentSettingsLayout.captionLineHeight)
.padding(.top, SodaSpacing.s14)
HStack(spacing: SodaSpacing.s12) {
preferenceButton(.ALL, title: I18n.Settings.Content.all)
preferenceButton(.MALE, title: I18n.Settings.Content.maleOriented)
preferenceButton(.FEMALE, title: I18n.Settings.Content.femaleOriented)
}
.padding(.top, AuthContentSettingsLayout.radioRowGap)
.padding(.bottom, AuthContentSettingsLayout.radioBottomInset)
}
}
private func preferenceButton(_ type: ContentType, title: String) -> some View {
Button {
contentType = type
} label: {
HStack(spacing: SodaSpacing.s6) {
Circle()
.stroke(Color.gray700, lineWidth: AuthContentSettingsLayout.strokeWidth)
.frame(width: AuthContentSettingsLayout.radioSize, height: AuthContentSettingsLayout.radioSize)
.overlay {
if contentType == type {
Circle()
.fill(Color.soda400)
.frame(width: AuthContentSettingsLayout.radioDotSize, height: AuthContentSettingsLayout.radioDotSize)
}
}
Text(title)
.appFont(.body2)
.foregroundColor(.white)
.fixedSize(horizontal: false, vertical: true)
}
.frame(maxWidth: .infinity, minHeight: AuthContentSettingsLayout.touchHeight, alignment: .leading)
.contentShape(Rectangle())
}
.buttonStyle(.plain)
.accessibilityLabel(title)
.accessibilityValue(contentType == type ? I18n.Settings.Content.selectedPreference : I18n.Settings.Content.unselectedPreference)
.accessibilityAddTraits(contentType == type ? .isSelected : [])
.accessibilityIdentifier("authContentSettings.preference.\(type.rawValue)")
}
}
private struct AuthContentSettingsToggleStyle: ToggleStyle {
func makeBody(configuration: Configuration) -> some View {
Button {
configuration.isOn.toggle()
} label: {
Capsule()
.fill(configuration.isOn ? Color.soda400 : Color.gray500)
.frame(width: AuthContentSettingsLayout.switchWidth, height: AuthContentSettingsLayout.switchHeight)
.overlay(alignment: configuration.isOn ? .trailing : .leading) {
Circle()
.fill(Color.white)
.frame(width: SodaSpacing.s20, height: SodaSpacing.s20)
.padding(AuthContentSettingsLayout.switchInset)
}
.frame(minHeight: AuthContentSettingsLayout.touchHeight)
.contentShape(Rectangle())
}
.buttonStyle(.plain)
.accessibilityRepresentation {
Toggle(isOn: configuration.$isOn) {
configuration.label
}
.toggleStyle(.switch)
}
}
}
private struct AuthContentSettingsModifier: ViewModifier {
@ObservedObject var viewModel: MyPageViewModel
let onCancel: () -> Void
@Environment(\.accessibilityReduceMotion) private var reduceMotion
@State private var isHostPresented = false
@State private var panelProgress: CGFloat = 0
@State private var isExitDialogPresented = false
@AccessibilityFocusState private var isExitDialogFocused: Bool
private var callerErrorIsPresented: Binding<Bool> {
Binding(
get: { viewModel.isShowPopup && !viewModel.isShowAuthContentSettings },
set: { viewModel.isShowPopup = $0 }
)
}
func body(content: Content) -> some View {
content
.disabled(viewModel.isSubmittingAuth)
.overlay {
if viewModel.isSubmittingAuth {
LoadingView()
}
}
.sodaToast(isPresented: callerErrorIsPresented, message: viewModel.errorMessage, autohideIn: 2)
.fullScreenCover(isPresented: $isHostPresented, onDismiss: {
dismissExitDialog()
panelProgress = 0
viewModel.submitPendingAuthVerification()
}) {
GeometryReader { proxy in
ZStack(alignment: .bottom) {
Color.black.opacity(0.6)
.ignoresSafeArea()
AuthContentSettingsSheet(
isAdultContentVisible: $viewModel.authIsAdultContentVisible,
contentType: $viewModel.authContentType,
onConfirm: viewModel.confirmAuthContentSettings,
onClose: showExitDialog
)
.padding(.leading, proxy.safeAreaInsets.leading)
.padding(.trailing, proxy.safeAreaInsets.trailing)
.padding(.bottom, proxy.safeAreaInsets.bottom)
.background(Color.gray900)
.clipShape(RoundedCorner(radius: SodaRadius.r14, corners: [.topLeft, .topRight]))
.accessibilityElement(children: .contain)
.accessibilityIdentifier("authContentSettings.panel")
.disabled(viewModel.isSubmittingAuth)
.overlay {
if viewModel.isSubmittingAuth {
LoadingView()
}
}
.sodaToast(isPresented: $viewModel.isShowPopup, message: viewModel.errorMessage, autohideIn: 2)
.disabled(isExitDialogPresented)
.accessibilityHidden(isExitDialogPresented)
.modifier(AuthContentSettingsPanelMotion(
progress: panelProgress,
reduceMotion: reduceMotion,
onHidden: closeHostIfHidden
))
}
.ignoresSafeArea(.container, edges: [.horizontal, .bottom])
}
.overlay {
if isExitDialogPresented {
exitDialog
}
}
.interactiveDismissDisabled(true)
.presentationBackground(.clear)
.onAppear {
DispatchQueue.main.async {
updatePanel()
}
}
.onDisappear(perform: dismissExitDialog)
}
.onAppear {
if viewModel.isShowAuthContentSettings {
setHostPresented(true)
}
}
.onChange(of: viewModel.isShowAuthContentSettings) { isPresented in
if !isPresented {
dismissExitDialog()
}
if isPresented && !isHostPresented {
setHostPresented(true)
} else if isHostPresented {
updatePanel()
}
}
.onChange(of: reduceMotion) { _ in
if isHostPresented {
updatePanel()
}
}
}
private var exitDialog: some View {
SodaV2ActionModal(
title: I18n.Settings.Content.authExitTitle,
message: I18n.Settings.Content.authExitMessage,
button1: SodaV2ActionModalButton(
label: I18n.Settings.Content.authExitConfirm,
action: confirmExit
),
button2: SodaV2ActionModalButton(
label: I18n.Settings.Content.authExitCancel,
action: dismissExitDialog
),
onDimmedTap: dismissExitDialog
)
.accessibilityElement(children: .contain)
.accessibilityFocused($isExitDialogFocused)
.accessibilityAction(.escape, dismissExitDialog)
.onAppear {
isExitDialogFocused = true
}
}
private func showExitDialog() {
guard isHostPresented, viewModel.isShowAuthContentSettings, !viewModel.isSubmittingAuth else { return }
isExitDialogPresented = true
}
private func dismissExitDialog() {
isExitDialogPresented = false
isExitDialogFocused = false
}
private func confirmExit() {
guard isExitDialogPresented, isHostPresented, viewModel.isShowAuthContentSettings, !viewModel.isSubmittingAuth else { return }
dismissExitDialog()
viewModel.cancelAuthContentSettings()
onCancel()
}
private func setHostPresented(_ isPresented: Bool) {
var transaction = Transaction()
transaction.disablesAnimations = true
withTransaction(transaction) {
isHostPresented = isPresented
}
}
private func updatePanel() {
let progress: CGFloat = viewModel.isShowAuthContentSettings ? 1 : 0
if reduceMotion || panelProgress == progress {
panelProgress = progress
closeHostIfHidden()
} else {
withAnimation(.easeInOut(duration: 0.25)) {
panelProgress = progress
}
}
}
private func closeHostIfHidden() {
guard isHostPresented, panelProgress == 0, !viewModel.isShowAuthContentSettings else { return }
setHostPresented(false)
}
}
private struct AuthContentSettingsPanelMotion: GeometryEffect {
var progress: CGFloat
let reduceMotion: Bool
let onHidden: () -> Void
var animatableData: CGFloat {
get { progress }
set {
progress = newValue
}
}
func effectValue(size: CGSize) -> ProjectionTransform {
if progress == 0 {
DispatchQueue.main.async(execute: onHidden)
}
return ProjectionTransform(CGAffineTransform(translationX: 0, y: reduceMotion ? 0 : size.height * (1 - progress)))
}
}
extension View {
func authContentSettings(viewModel: MyPageViewModel, onCancel: @escaping () -> Void = {}) -> some View {
modifier(AuthContentSettingsModifier(viewModel: viewModel, onCancel: onCancel))
}
}
struct AuthContentSettingsSheet_Previews: PreviewProvider {
static var previews: some View {
Group {
AuthContentSettingsSheet(isAdultContentVisible: .constant(true), contentType: .constant(.ALL), onConfirm: {}, onClose: {})
.frame(width: 402)
.previewDisplayName("ON / ALL")
AuthContentSettingsSheet(isAdultContentVisible: .constant(false), contentType: .constant(.ALL), onConfirm: {}, onClose: {})
.frame(width: 402)
.previewDisplayName("OFF / ALL")
}
.padding(.bottom, 34)
.background(Color.gray900)
.clipShape(RoundedCorner(radius: SodaRadius.r14, corners: [.topLeft, .topRight]))
.environment(\.locale, Locale(identifier: "ko"))
.preferredColorScheme(.dark)
.previewLayout(.sizeThatFits)
}
}
@@ -0,0 +1,46 @@
import SwiftUI
import Bootpay
#if !AUTH_VERIFICATION_MOCK
import BootpayUI
#endif
struct AuthVerificationView: View {
let payload: Payload
let onCancel: () -> Void
let onError: () -> Void
let onDone: ([String: Any]) -> Void
let onClose: () -> Void
#if AUTH_VERIFICATION_MOCK
@State private var hasCompleted = false
#endif
var body: some View {
#if AUTH_VERIFICATION_MOCK
LoadingView()
.background(Color.white.ignoresSafeArea())
.task {
guard !hasCompleted else { return }
do {
try await Task.sleep(nanoseconds: 500_000_000)
} catch is CancellationError {
return
} catch {
onError()
return
}
guard !Task.isCancelled, !hasCompleted else { return }
hasCompleted = true
onDone(["data": ["receipt_id": "dev-mock-auth-receipt"]])
}
#else
BootpayUI(payload: payload, requestType: BootpayRequest.TYPE_AUTHENTICATION)
.onConfirm { _ in true }
.onCancel { _ in onCancel() }
.onError { _ in onError() }
.onDone(onDone)
.onClose(onClose)
#endif
}
}
@@ -6,11 +6,13 @@ struct SodaV2ActionModalButton {
}
struct SodaV2ActionModal: View {
@Environment(\.dynamicTypeSize) private var dynamicTypeSize
let title: String
let message: String
let button1: SodaV2ActionModalButton?
let button2: SodaV2ActionModalButton?
let onDimmedTap: () -> Void
var primaryTextColor: Color = .soda400
private var visibleButtons: [(label: String, action: () -> Void, isPrimary: Bool)] {
var buttons = [(label: String, action: () -> Void, isPrimary: Bool)]()
@@ -31,32 +33,53 @@ struct SodaV2ActionModal: View {
}
var body: some View {
ZStack {
Color.black.opacity(0.6)
.ignoresSafeArea()
.onTapGesture(perform: onDimmedTap)
GeometryReader { proxy in
ZStack {
Color.black.opacity(0.6)
.ignoresSafeArea()
.onTapGesture(perform: onDimmedTap)
VStack(spacing: 0) {
Text(title)
.appFont(size: 20, weight: .bold)
.foregroundColor(Color.white)
.multilineTextAlignment(.center)
.frame(width: 340, height: 64)
VStack(spacing: 0) {
ViewThatFits(in: .vertical) {
messageContent
.fixedSize(horizontal: false, vertical: true)
Text(message)
.appFont(size: 16, weight: .regular)
.foregroundColor(Color.white)
.multilineTextAlignment(.center)
.padding(20)
.frame(width: 340)
ScrollView {
messageContent
}
.scrollBounceBehavior(.basedOnSize)
}
buttonArea
.padding(.horizontal, 20)
.padding(.vertical, 14)
.frame(width: 340)
buttonArea
.padding(.horizontal, 20)
.padding(.vertical, 14)
.fixedSize(horizontal: false, vertical: true)
}
.frame(width: min(dynamicTypeSize.isAccessibilitySize ? proxy.size.width : 340, proxy.size.width - 32))
.background(Color.gray900)
.cornerRadius(14)
.padding(16)
}
.background(Color.gray900)
.cornerRadius(14)
.frame(width: proxy.size.width, height: proxy.size.height)
}
}
private var messageContent: some View {
VStack(spacing: 0) {
Text(title)
.appFont(size: 20, weight: .bold)
.foregroundColor(Color.white)
.multilineTextAlignment(.center)
.fixedSize(horizontal: false, vertical: true)
.frame(maxWidth: .infinity, minHeight: 64)
Text(message)
.appFont(size: 16, weight: .regular)
.foregroundColor(Color.white)
.multilineTextAlignment(.center)
.fixedSize(horizontal: false, vertical: true)
.padding(20)
.frame(maxWidth: .infinity)
}
}
@@ -79,7 +102,9 @@ struct SodaV2ActionModal: View {
Button(action: action) {
Text(title)
.appFont(size: 18, weight: .medium)
.foregroundColor(isPrimary ? Color.soda400 : Color.white)
.foregroundColor(isPrimary ? primaryTextColor : Color.white)
.multilineTextAlignment(.center)
.fixedSize(horizontal: false, vertical: true)
.frame(maxWidth: .infinity)
.padding(14)
.background(Color.clear)
@@ -55,6 +55,9 @@ struct CreatorChannelHeaderSection: View {
.multilineTextAlignment(.center)
CreatorChannelTalkActionSection(
recipientMemberId: creator.creatorId,
recipientCreatorNickname: creator.nickname,
recipientCreatorProfileImageUrl: creator.profileImageUrl,
isAiChatAvailable: creator.isAiChatAvailable,
isDmAvailable: creator.isDmAvailable,
isOwnCreatorChannel: isOwnCreatorChannel,
@@ -1,6 +1,5 @@
import SwiftUI
import Bootpay
import BootpayUI
struct CreatorChannelView: View {
let creatorId: Int
@@ -256,9 +255,10 @@ struct CreatorChannelView: View {
ActivityViewController(activityItems: [viewModel.shareMessage])
}
)
.fullScreenCover(isPresented: $isShowAuthView) {
.fullScreenCover(isPresented: $isShowAuthView, onDismiss: mypageViewModel.presentAuthContentSettings) {
authView
}
.authContentSettings(viewModel: mypageViewModel, onCancel: { pendingAction = nil })
.onAppear {
configurePayload()
if viewModel.hasLoaded == false {
@@ -490,26 +490,25 @@ struct CreatorChannelView: View {
}
private var authView: some View {
BootpayUI(payload: payload, requestType: BootpayRequest.TYPE_AUTHENTICATION)
.onConfirm { _ in true }
.onCancel { _ in isShowAuthView = false }
.onError { _ in
AuthVerificationView(
payload: payload,
onCancel: { isShowAuthView = false },
onError: {
AppState.shared.errorMessage = I18n.Chat.Auth.authenticationError
AppState.shared.isShowErrorPopup = true
isShowAuthView = false
}
.onDone {
DEBUG_LOG("onDone: \($0)")
},
onDone: {
let action = pendingAction
mypageViewModel.authVerify($0) {
auth = true
isShowAuthView = false
if let action = pendingAction {
pendingAction = nil
action()
}
pendingAction = nil
action?()
}
}
.onClose { isShowAuthView = false }
isShowAuthView = false
},
onClose: { isShowAuthView = false }
)
}
private func configurePayload() {
@@ -1,12 +1,24 @@
import SwiftUI
struct CreatorChannelTalkActionSection: View {
let recipientMemberId: Int
let recipientCreatorNickname: String
let recipientCreatorProfileImageUrl: String
let isAiChatAvailable: Bool
let isDmAvailable: Bool
let isOwnCreatorChannel: Bool
let onTapTalk: () -> Void
let onTapDm: () -> Void
private var shouldShowGiftButton: Bool {
let normalizedCountryCode = UserDefaults
.string(forKey: .countryCode)
.trimmingCharacters(in: .whitespacesAndNewlines)
.uppercased()
let isKoreanCountry = normalizedCountryCode.isEmpty || normalizedCountryCode == "KR"
return isOwnCreatorChannel == false && isDmAvailable && isKoreanCountry && LanguageHeaderProvider.current == "ko"
}
var body: some View {
HStack(spacing: SodaSpacing.s8) {
Spacer()
@@ -51,6 +63,33 @@ struct CreatorChannelTalkActionSection: View {
.buttonStyle(.plain)
}
if shouldShowGiftButton {
Button(action: {
AppState.shared.setAppStep(step: .giftSend(
recipientMemberId: recipientMemberId,
recipientCreatorNickname: recipientCreatorNickname,
recipientCreatorProfileImageUrl: recipientCreatorProfileImageUrl
))
}) {
HStack(spacing: SodaSpacing.s6) {
Image("ic_send_gift")
.resizable()
.frame(width: 20, height: 20)
.accessibilityHidden(true)
Text(I18n.CreatorChannelHome.sendGift)
.appFont(size: 16, weight: .medium)
.foregroundColor(.black)
}
.padding(SodaSpacing.s12)
.background(
Capsule()
.fill(Color.white)
)
}
.buttonStyle(.plain)
}
Spacer()
}
.frame(height: 44)
@@ -0,0 +1,39 @@
import SwiftUI
struct GiftAgreementRow: View {
let title: String
@Binding var isAgreed: Bool
var policyURL: URL? = GiftConstants.termsURL
var body: some View {
HStack(alignment: .top, spacing: SodaSpacing.s4) {
Button {
isAgreed.toggle()
} label: {
HStack(alignment: .top, spacing: SodaSpacing.s8) {
Image(isAgreed ? "btn_select_checked" : "btn_select_normal")
.resizable()
.frame(width: 22, height: 22)
Text(title)
.appFont(size: 16, weight: .medium)
.foregroundColor(.white)
.multilineTextAlignment(.leading)
.frame(maxWidth: .infinity, alignment: .leading)
}
.contentShape(Rectangle())
}
.buttonStyle(.plain)
.accessibilityValue(isAgreed ? "동의함" : "동의 안 함")
if let url = policyURL {
Link(destination: url) {
Text("(필수)")
.underline()
.appFont(size: 16, weight: .medium)
.foregroundColor(.soda400)
}
.accessibilityLabel("필수 약관 보기")
}
}
}
}
@@ -0,0 +1,33 @@
enum GiftContactInputRule {
case name
case phoneNumber
func acceptsEditing(_ text: String) -> Bool {
switch self {
case .name:
return text.count <= 12 && text.unicodeScalars.allSatisfy { scalar in
switch scalar.value {
case 0x41...0x5A, 0x61...0x7A,
0x1100...0x11FF, 0x3130...0x318F,
0xA960...0xA97F, 0xAC00...0xD7A3, 0xD7B0...0xD7FF:
return true
default:
return false
}
}
case .phoneNumber:
return text.count <= 11 && text.unicodeScalars.allSatisfy {
(0x30...0x39).contains($0.value)
}
}
}
func acceptsSubmission(_ text: String) -> Bool {
switch self {
case .name:
return !text.isEmpty && acceptsEditing(text)
case .phoneNumber:
return text.count == 11 && text.hasPrefix("010") && acceptsEditing(text)
}
}
}
@@ -0,0 +1,91 @@
import SwiftUI
import UIKit
struct GiftContactTextField: UIViewRepresentable {
@Binding var text: String
let rule: GiftContactInputRule
func makeCoordinator() -> Coordinator {
Coordinator(parent: self)
}
func makeUIView(context: Context) -> UITextField {
let textField = UITextField(frame: .zero)
textField.delegate = context.coordinator
textField.text = text
textField.backgroundColor = .clear
textField.textColor = .white
textField.font = SodaTypography.body3.localizedFontName()
.flatMap { UIFont(name: $0, size: SodaTypography.body3.size) }
?? UIFont.systemFont(ofSize: SodaTypography.body3.size, weight: .regular)
textField.autocorrectionType = .no
textField.autocapitalizationType = .none
let placeholder: String
switch rule {
case .name:
placeholder = "이름을 입력해 주세요"
textField.textContentType = .name
case .phoneNumber:
placeholder = "휴대폰 번호를 입력해 주세요"
textField.keyboardType = .numberPad
textField.textContentType = .telephoneNumber
}
textField.attributedPlaceholder = NSAttributedString(
string: placeholder,
attributes: [.foregroundColor: UIColor(Color.gray600)]
)
textField.setContentHuggingPriority(.defaultLow, for: .horizontal)
textField.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
textField.addTarget(context.coordinator, action: #selector(Coordinator.textDidChange(_:)), for: .editingChanged)
return textField
}
func updateUIView(_ uiView: UITextField, context: Context) {
context.coordinator.parent = self
guard uiView.markedTextRange == nil,
text != context.coordinator.lastAcceptedText,
rule.acceptsEditing(text) else { return }
context.coordinator.lastAcceptedText = text
if uiView.text != text {
uiView.text = text
}
}
final class Coordinator: NSObject, UITextFieldDelegate {
var parent: GiftContactTextField
var lastAcceptedText: String
init(parent: GiftContactTextField) {
self.parent = parent
lastAcceptedText = parent.rule.acceptsEditing(parent.text) ? parent.text : ""
}
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString replacement: String) -> Bool {
guard textField.markedTextRange == nil else { return true }
let current = textField.text ?? ""
let prospective = (current as NSString).replacingCharacters(in: range, with: replacement)
return parent.rule.acceptsEditing(prospective)
}
@objc func textDidChange(_ textField: UITextField) {
guard textField.markedTextRange == nil else { return }
let committed = textField.text ?? ""
guard parent.rule.acceptsEditing(committed) else {
textField.text = lastAcceptedText
return
}
lastAcceptedText = committed
if parent.text != committed {
parent.text = committed
}
}
func textFieldDidChangeSelection(_ textField: UITextField) {
textDidChange(textField)
}
func textFieldDidEndEditing(_ textField: UITextField) {
textDidChange(textField)
}
}
}
@@ -0,0 +1,25 @@
import Foundation
enum GiftConstants {
static let termsURL = URL(string: "https://app.notion.com/p/3eb27b359673802b937ae741ab7b4ad3")
static let damagePolicyURL = URL(string: "https://app.notion.com/p/3f227b3596738018ba5dea2e5205293b")
static let addressSearchAvailable = false
static let feedbackStep: AppStep = .serviceCenter
static let unavailableActionMessage = "준비 중입니다."
static let courierCompanyNames = [
"CJ대한통운",
"우체국택배",
"GS25 편의점택배",
"CU 편의점택배",
"한진택배",
"롯데택배",
"로젠택배",
"경동택배",
"대신택배",
"일양로지스",
"천일택배",
"합동택배",
"건영택배",
"농협택배"
]
}
@@ -0,0 +1,91 @@
import SwiftUI
struct GiftCancelCompleteView: View {
let model: SentGiftDetailDisplayModel
@State private var isNavigating = false
var body: some View {
VStack(alignment: .leading, spacing: SodaSpacing.s32) {
VStack(alignment: .leading, spacing: SodaSpacing.s14) {
Text("취소 완료")
.appFont(.caption2)
.foregroundColor(.white)
.padding(.horizontal, SodaSpacing.s8)
.padding(.vertical, SodaSpacing.s4)
.background(Color.gray700)
.clipShape(RoundedRectangle(cornerRadius: SodaRadius.r4))
Text("선물 신청이 취소되었어요")
.appFont(.heading2)
.foregroundColor(.white)
.accessibilityAddTraits(.isHeader)
Text(completionMessage)
.appFont(.body6)
.foregroundColor(.gray300)
}
.fixedSize(horizontal: false, vertical: true)
.frame(maxWidth: .infinity, alignment: .leading)
VStack(spacing: SodaSpacing.s12) {
GiftInfoSectionView(title: "취소 상세") {
if let creatorNickname {
GiftInfoRow(title: "크리에이터", value: creatorNickname)
}
GiftInfoRow(title: "선물 사이즈", value: model.sizeName)
GiftInfoRow(title: "카테고리", value: model.categoryName)
GiftInfoRow(title: "신청번호", value: model.applicationNo)
if let applicationDate = model.applicationDateText {
GiftInfoRow(title: "신청일", value: applicationDate)
}
if let canceledDate = model.canceledDateText {
GiftInfoRow(title: "취소일", value: canceledDate)
}
if let paidCan = model.paidCan {
GiftInfoRow(title: "환불 캔", value: String(paidCan))
}
}
inquiryButton
}
}
.frame(maxWidth: .infinity, alignment: .leading)
.onAppear {
isNavigating = false
}
}
private var inquiryButton: some View {
Button {
guard !isNavigating else { return }
isNavigating = true
ServiceCenterInquiry.openTalk()
} label: {
Text("문의하기")
.appFont(.body2)
.foregroundColor(isNavigating ? .gray500 : .white)
.multilineTextAlignment(.center)
.fixedSize(horizontal: false, vertical: true)
.padding(.horizontal, SodaSpacing.s16)
.padding(.vertical, SodaSpacing.s12)
.frame(maxWidth: .infinity, minHeight: SodaSpacing.s48)
.overlay(Capsule().strokeBorder(Color.gray800))
.contentShape(Capsule())
}
.buttonStyle(.plain)
.disabled(isNavigating)
}
private var creatorNickname: String? {
guard let nickname = model.recipientCreatorNickname?.trimmingCharacters(in: .whitespacesAndNewlines),
!nickname.isEmpty else { return nil }
return nickname
}
private var completionMessage: String {
let recipient = creatorNickname.map { "\($0)에게 보내는 " } ?? ""
let applicationNo = model.applicationNo.trimmingCharacters(in: .whitespacesAndNewlines)
let application = applicationNo.isEmpty ? "" : "(\(applicationNo))"
return "\(recipient)선물 신청\(application)이 취소되었습니다. 취소한 신청은 되돌릴 수 없으며, 다시 보내려면 새로 신청해 주세요."
}
}
@@ -0,0 +1,84 @@
import SwiftUI
struct GiftDetailActionBar: View {
let model: SentGiftDetailDisplayModel
var onCancel: (() -> Void)? = nil
let onPolicy: () -> Void
@State private var isNavigating = false
var body: some View {
if model.trackingRequired || model.status == .received || model.status == .undeliverable {
VStack(spacing: SodaSpacing.s8) {
if model.trackingRequired {
Button {
guard !isNavigating else { return }
isNavigating = true
AppState.shared.setAppStep(step: .giftTrackingRegistration(applicationNo: model.applicationNo))
} label: {
SelectedButtonView(
title: "운송장 작성하기",
isActive: !isNavigating,
isSelected: false,
bgDefaultColor: .button,
textDefaultColor: .white
)
.multilineTextAlignment(.center)
.fixedSize(horizontal: false, vertical: true)
.frame(minHeight: SodaSpacing.s48)
.contentShape(Rectangle())
}
.disabled(isNavigating)
}
if model.status == .received {
Button {
onCancel?()
} label: {
secondaryLabel("신청 취소", isEnabled: onCancel != nil)
}
.disabled(onCancel == nil)
.accessibilityHint(onCancel == nil ? "현재 신청 취소를 이용할 수 없습니다." : "")
}
if model.status == .undeliverable {
Button {
guard !isNavigating else { return }
isNavigating = true
ServiceCenterInquiry.openTalk()
} label: {
secondaryLabel("문의하기", isEnabled: !isNavigating)
}
.disabled(isNavigating)
Button {
onPolicy()
} label: {
secondaryLabel("선물 정책 확인")
}
}
}
.buttonStyle(.plain)
.padding(.horizontal, SodaSpacing.s14)
.padding(.vertical, SodaSpacing.s12)
.frame(maxWidth: .infinity)
.background(Color.black)
.onAppear {
isNavigating = false
}
}
}
private func secondaryLabel(_ title: String, isEnabled: Bool = true) -> some View {
Text(title)
.appFont(.body2)
.foregroundColor(isEnabled ? .white : .gray500)
.multilineTextAlignment(.center)
.fixedSize(horizontal: false, vertical: true)
.padding(.horizontal, SodaSpacing.s16)
.padding(.vertical, SodaSpacing.s12)
.frame(maxWidth: .infinity, minHeight: SodaSpacing.s48)
.background(Color.gray900)
.clipShape(RoundedRectangle(cornerRadius: SodaRadius.r8))
.contentShape(Rectangle())
}
}
@@ -0,0 +1,43 @@
import SwiftUI
struct GiftInfoSectionView<Content: View>: View {
let title: String
@ViewBuilder let content: Content
var body: some View {
VStack(alignment: .leading, spacing: SodaSpacing.s24) {
Text(title)
.appFont(.body1)
.foregroundColor(.white)
.accessibilityAddTraits(.isHeader)
VStack(alignment: .leading, spacing: SodaSpacing.s14) {
content
}
.padding(SodaSpacing.s14)
.frame(maxWidth: .infinity, alignment: .leading)
.background(Color.gray900)
.clipShape(RoundedRectangle(cornerRadius: SodaRadius.r14))
}
.frame(maxWidth: .infinity, alignment: .leading)
}
}
struct GiftInfoRow: View {
let title: String
let value: String
var body: some View {
HStack(alignment: .top, spacing: SodaSpacing.s24) {
Text(title)
.foregroundColor(.gray500)
.frame(width: SodaSpacing.s48 + SodaSpacing.s24, alignment: .leading)
Text(value)
.foregroundColor(.white)
.frame(maxWidth: .infinity, alignment: .leading)
}
.appFont(.body6)
.fixedSize(horizontal: false, vertical: true)
.accessibilityElement(children: .combine)
}
}
@@ -0,0 +1,41 @@
import SwiftUI
struct GiftProgressView: View {
let progress: [GiftProgressDisplayModel]
var body: some View {
HStack(alignment: .top, spacing: SodaSpacing.s4) {
ForEach(progress, id: \.step) { model in
VStack(spacing: SodaSpacing.s12) {
Capsule()
.fill(model.occurredDateText != nil ? Color.soda400 : Color.gray700)
.frame(height: SodaSpacing.s4)
.accessibilityHidden(true)
VStack(spacing: SodaSpacing.s8) {
Text(model.step.title)
.foregroundColor(model.occurredDateText != nil ? .white : .gray500)
if let date = model.occurredDateText {
Text(date)
.foregroundColor(.gray400)
}
}
.appFont(.caption3)
.multilineTextAlignment(.center)
.fixedSize(horizontal: false, vertical: true)
}
.frame(maxWidth: .infinity, alignment: .top)
}
}
.padding(SodaSpacing.s14)
.frame(maxWidth: .infinity, alignment: .leading)
.background(Color.gray900)
.clipShape(RoundedRectangle(cornerRadius: SodaRadius.r14))
.accessibilityElement(children: .ignore)
.accessibilityLabel(progress.enumerated().map { index, model in
["\(index + 1)단계", model.step.title, model.occurredDateText,
model.occurredDateText != nil ? "완료" : "미완료"]
.compactMap { $0 }.joined(separator: ", ")
}.joined(separator: "; "))
}
}
@@ -0,0 +1,157 @@
import SwiftUI
struct ReceivedGiftDetailContentView: View {
let model: ReceivedGiftDetailDisplayModel
var body: some View {
VStack(alignment: .leading, spacing: SodaSpacing.s32) {
hero
if model.status == .undeliverable {
undeliverableReason
} else {
if model.status != .canceled {
GiftProgressView(progress: model.progress)
}
giftInfo
recipientAddress
}
}
.frame(maxWidth: .infinity, alignment: .leading)
}
private var hero: some View {
VStack(alignment: .leading, spacing: SodaSpacing.s14) {
if let statusLabel {
Text(statusLabel)
.appFont(.caption2)
.foregroundColor(model.status == .undeliverable ? .red400 : .soda400)
.padding(.horizontal, SodaSpacing.s8)
.padding(.vertical, SodaSpacing.s4)
.background(Color.gray900)
.clipShape(RoundedRectangle(cornerRadius: SodaRadius.r4))
}
Text(heroTitle)
.appFont(.heading1)
.foregroundColor(.white)
.accessibilityAddTraits(.isHeader)
if model.status == .undeliverable {
Text("보내주신 선물은 소다라이브 선물 정책에 따라 크리에이터에게 전달할 수 없는 품목으로 확인되었습니다.")
.appFont(.body6)
.foregroundColor(.gray500)
}
}
.fixedSize(horizontal: false, vertical: true)
.frame(maxWidth: .infinity, alignment: .leading)
}
private var statusLabel: String? {
switch model.status {
case .trackingRegistered: return "배송지 입력 완료"
case .delivered: return "전달 완료"
case .undeliverable: return "전달 불가"
case .received, .arrivedAtMailbox, .inspectionCompleted, .canceled: return nil
}
}
private var heroTitle: String {
switch model.status {
case .trackingRegistered: return "배송지 입력이 완료되었어요"
case .delivered: return "선물을 전달받았어요"
case .undeliverable: return "전달할 수 없는 품목입니다"
case .received, .arrivedAtMailbox, .inspectionCompleted, .canceled: return model.statusName
}
}
private var giftInfo: some View {
GiftInfoSectionView(title: "선물 정보") {
if let nickname = model.senderNickname {
GiftInfoRow(title: "보낸 사람", value: nickname)
}
GiftInfoRow(title: "선물 사이즈", value: model.sizeName)
GiftInfoRow(title: "카테고리", value: model.categoryName)
}
}
@ViewBuilder
private var recipientAddress: some View {
if let address = model.recipientAddress {
GiftInfoSectionView(title: "받는 주소") {
GiftInfoRow(title: "이름", value: address.name)
GiftInfoRow(title: "휴대폰 번호", value: address.phoneNumber)
GiftInfoRow(title: "주소", value: address.address)
}
}
}
private var undeliverableReason: some View {
GiftInfoSectionView(title: "사유") {
if let reason = model.undeliverableReason?.trimmingCharacters(in: .whitespacesAndNewlines),
!reason.isEmpty {
Text(reason)
.appFont(.body6)
.foregroundColor(.white)
.fixedSize(horizontal: false, vertical: true)
.frame(maxWidth: .infinity, alignment: .leading)
Divider()
.overlay(Color.gray800)
.accessibilityHidden(true)
}
Text("해당 선물은 보관기간(입고일 포함 최대 7일) 내에 반송 등 필요한 조치가 완료되지 않을 경우, 사전에 동의한 약관 및 폐기 등의 내용에 따라 폐기될 수 있습니다. 자세한 내용은 고객센터로 문의해 주세요.")
.appFont(.body6)
.foregroundColor(.red400)
.fixedSize(horizontal: false, vertical: true)
.frame(maxWidth: .infinity, alignment: .leading)
}
}
}
struct ReceivedGiftDetailActionBar: View {
let onPolicy: () -> Void
@State private var isNavigating = false
var body: some View {
VStack(spacing: SodaSpacing.s8) {
Button {
guard !isNavigating else { return }
isNavigating = true
ServiceCenterInquiry.openTalk()
} label: {
secondaryLabel("문의하기", isEnabled: !isNavigating)
}
.disabled(isNavigating)
Button {
onPolicy()
} label: {
secondaryLabel("선물 정책 확인")
}
}
.buttonStyle(.plain)
.padding(.horizontal, SodaSpacing.s14)
.padding(.vertical, SodaSpacing.s12)
.frame(maxWidth: .infinity)
.background(Color.black)
.onAppear {
isNavigating = false
}
}
private func secondaryLabel(_ title: String, isEnabled: Bool = true) -> some View {
Text(title)
.appFont(.body2)
.foregroundColor(isEnabled ? .white : .gray500)
.multilineTextAlignment(.center)
.fixedSize(horizontal: false, vertical: true)
.padding(.horizontal, SodaSpacing.s16)
.padding(.vertical, SodaSpacing.s12)
.frame(maxWidth: .infinity, minHeight: SodaSpacing.s48)
.background(Color.gray900)
.clipShape(RoundedRectangle(cornerRadius: SodaRadius.r8))
.contentShape(Rectangle())
}
}
@@ -0,0 +1,149 @@
import SwiftUI
struct SentGiftDetailContentView: View {
let model: SentGiftDetailDisplayModel
var body: some View {
VStack(alignment: .leading, spacing: SodaSpacing.s32) {
hero
if model.status == .undeliverable {
undeliverableReason
} else if model.status != .canceled {
GiftProgressView(progress: model.progress)
}
if model.status == .received {
mailbox
}
giftInfo
sender
if model.status != .received {
mailbox
}
}
.frame(maxWidth: .infinity, alignment: .leading)
}
private var hero: some View {
VStack(alignment: .leading, spacing: SodaSpacing.s14) {
if let statusLabel {
Text(statusLabel)
.appFont(.caption2)
.foregroundColor(model.status == .undeliverable ? .red400 : .soda400)
.padding(.horizontal, SodaSpacing.s8)
.padding(.vertical, SodaSpacing.s4)
.background(Color.gray900)
.clipShape(RoundedRectangle(cornerRadius: SodaRadius.r4))
}
Text(heroTitle)
.appFont(.heading1)
.foregroundColor(.white)
.accessibilityAddTraits(.isHeader)
if let heroBody {
Text(heroBody)
.appFont(.body6)
.foregroundColor(.gray500)
}
}
.fixedSize(horizontal: false, vertical: true)
.frame(maxWidth: .infinity, alignment: .leading)
}
private var statusLabel: String? {
switch model.status {
case .trackingRegistered: return "발송 확인"
case .delivered: return "전달 완료"
case .undeliverable: return "전달 불가"
case .received, .arrivedAtMailbox, .inspectionCompleted, .canceled: return nil
}
}
private var heroTitle: String {
switch model.status {
case .received: return "선물 신청 완료!"
case .trackingRegistered: return "사서함으로 이동 중이에요"
case .delivered: return "크리에이터에게 선물을 전달했어요"
case .undeliverable: return "전달할 수 없는 품목입니다"
case .arrivedAtMailbox, .inspectionCompleted, .canceled: return model.statusName
}
}
private var heroBody: String? {
switch model.status {
case .received:
return "선물이 정상적으로 접수되었어요!"
case .undeliverable:
return "보내주신 선물은 소다라이브 선물 정책에 따라 크리에이터에게 전달할 수 없는 품목으로 확인되었습니다."
case .trackingRegistered, .arrivedAtMailbox, .inspectionCompleted, .delivered, .canceled:
return nil
}
}
private var giftInfo: some View {
GiftInfoSectionView(title: "선물 정보") {
if let nickname = model.recipientCreatorNickname {
GiftInfoRow(title: "크리에이터", value: nickname)
}
GiftInfoRow(title: "선물 사이즈", value: model.sizeName)
GiftInfoRow(title: "카테고리", value: model.categoryName)
GiftInfoRow(title: "신청번호", value: model.applicationNo)
if let paidCan = model.paidCan {
GiftInfoRow(title: "캔", value: String(paidCan))
}
if let tracking = model.tracking,
!tracking.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
GiftInfoRow(title: "운송장 번호", value: tracking)
}
}
}
@ViewBuilder
private var sender: some View {
if let sender = model.senderInfo {
GiftInfoSectionView(title: "보내는 사람") {
GiftInfoRow(title: "이름", value: sender.name)
GiftInfoRow(title: "휴대폰 번호", value: sender.phoneNumber)
GiftInfoRow(title: "주소", value: sender.address)
}
}
}
@ViewBuilder
private var mailbox: some View {
if let mailbox = model.mailbox {
GiftInfoSectionView(title: model.status == .received ? "보내실 주소" : "받는 사서함") {
GiftInfoRow(title: "사서함", value: mailbox.name)
GiftInfoRow(title: "주소", value: mailbox.address)
GiftInfoRow(title: "연락처", value: mailbox.phoneNumber)
}
}
}
private var undeliverableReason: some View {
GiftInfoSectionView(title: "사유") {
if let reason = model.undeliverableReason?.trimmingCharacters(in: .whitespacesAndNewlines),
!reason.isEmpty {
Text(reason)
.appFont(.body6)
.foregroundColor(.white)
.fixedSize(horizontal: false, vertical: true)
.frame(maxWidth: .infinity, alignment: .leading)
Divider()
.overlay(Color.gray800)
.accessibilityHidden(true)
}
Text("해당 선물은 보관기간(입고일 포함 최대 7일) 내에 반송 등 필요한 조치가 완료되지 않을 경우, 사전에 동의한 약관 및 폐기 등의 내용에 따라 폐기될 수 있습니다. 자세한 내용은 고객센터로 문의해 주세요.")
.appFont(.body6)
.foregroundColor(.red400)
.fixedSize(horizontal: false, vertical: true)
.frame(maxWidth: .infinity, alignment: .leading)
}
}
}
@@ -0,0 +1,181 @@
import SwiftUI
struct GiftDetailView: View {
@Environment(\.openURL) private var openURL
@StateObject private var viewModel: GiftDetailViewModel
@StateObject private var recipientAddressViewModel: GiftRecipientAddressViewModel
@State private var hasAppeared = false
@State private var isActive = false
init(applicationNo: String) {
let detailViewModel = GiftDetailViewModel(applicationNo: applicationNo) { canceledApplicationNo, completion in
AppState.shared.replaceCurrentAppStep(
step: .giftDetail(applicationNo: canceledApplicationNo),
ifCurrentStep: { step in
guard case .giftDetail(let currentApplicationNo) = step else { return false }
return currentApplicationNo == canceledApplicationNo
},
completion: completion
)
}
_viewModel = StateObject(wrappedValue: detailViewModel)
_recipientAddressViewModel = StateObject(wrappedValue: GiftRecipientAddressViewModel(applicationNo: applicationNo, onSubmitted: {
detailViewModel.fetch()
}))
}
var body: some View {
VStack(spacing: 0) {
DetailNavigationBar(title: navigationTitle)
.disabled(viewModel.isCancelSubmitting || isRecipientAddressBusy)
BaseView(isLoading: .constant(viewModel.isLoading || recipientAddressViewModel.isSubmitting)) {
ZStack {
switch viewModel.renderState {
case .sent(let model):
detailContent {
SentGiftDetailContentView(model: model)
}
.safeAreaInset(edge: .bottom, spacing: 0) {
GiftDetailActionBar(
model: model,
onCancel: viewModel.presentCancelDialog,
onPolicy: openGiftTerms
)
}
case .received(let model):
if model.recipientAddressRequired {
VStack(spacing: 0) {
GiftRecipientAddressFormView(model: model, viewModel: recipientAddressViewModel)
if recipientAddressViewModel.hasSubmitted && !viewModel.isLoading && !viewModel.errorMessage.isEmpty {
retryContent
}
}
} else {
detailContent {
ReceivedGiftDetailContentView(model: model)
}
.safeAreaInset(edge: .bottom, spacing: 0) {
if model.status == .undeliverable {
ReceivedGiftDetailActionBar(onPolicy: openGiftTerms)
}
}
}
case .canceled(let model):
detailContent {
GiftCancelCompleteView(model: model)
}
case nil:
Color.clear.accessibilityHidden(true)
}
if viewModel.renderState == nil && !viewModel.errorMessage.isEmpty {
retryContent
}
}
}
.disabled(isRecipientAddressBusy)
}
.background(Color.black.ignoresSafeArea())
.allowsHitTesting(!viewModel.isShowingCancelDialog && !viewModel.isCancelSubmitting)
.accessibilityHidden(viewModel.isShowingCancelDialog)
.overlay {
if viewModel.isShowingCancelDialog {
SodaV2ActionModal(
title: "신청 취소",
message: cancelMessage,
button1: SodaV2ActionModalButton(label: "취소하기", action: viewModel.confirmCancel),
button2: SodaV2ActionModalButton(label: "나가기", action: viewModel.dismissCancelDialog),
onDimmedTap: viewModel.dismissCancelDialog,
primaryTextColor: .red400
)
.disabled(viewModel.isCancelSubmitting)
.allowsHitTesting(!viewModel.isCancelSubmitting)
}
}
.overlay {
if viewModel.isCancelSubmitting {
LoadingView()
}
}
.sodaToast(isPresented: $viewModel.isShowPopup, message: viewModel.errorMessage)
.sodaToast(isPresented: $recipientAddressViewModel.isShowPopup, message: recipientAddressViewModel.errorMessage)
.sodaToast(isPresented: $recipientAddressViewModel.isShowSuccessToast, message: recipientAddressViewModel.successMessage)
.onChange(of: recipientAddressViewModel.isShowSuccessToast) { isPresented in
if !isPresented && isActive {
recipientAddressViewModel.successToastDidDismiss()
}
}
.onAppear {
isActive = true
recipientAddressViewModel.successToastDidDismiss()
guard !hasAppeared else { return }
hasAppeared = true
viewModel.fetch()
}
.onDisappear {
isActive = false
}
}
private func openGiftTerms() {
guard let url = GiftConstants.termsURL else { return }
openURL(url)
}
private var isRecipientAddressBusy: Bool {
recipientAddressViewModel.isSubmitting || recipientAddressViewModel.isShowSuccessToast
|| (recipientAddressViewModel.hasSubmitted && viewModel.isLoading)
}
private var retryContent: some View {
VStack(spacing: SodaSpacing.s16) {
Text(viewModel.errorMessage)
.appFont(.body3)
.foregroundColor(.gray500)
.multilineTextAlignment(.center)
.fixedSize(horizontal: false, vertical: true)
Button(action: viewModel.fetch) {
Text("다시 시도")
.appFont(.body2)
.foregroundColor(.white)
.padding(.horizontal, SodaSpacing.s16)
.frame(minHeight: SodaSpacing.s48)
.background(Color.gray800)
.clipShape(Capsule())
}
.buttonStyle(.plain)
.disabled(viewModel.isLoading)
}
.padding(SodaSpacing.s24)
}
private func detailContent<Content: View>(@ViewBuilder content: () -> Content) -> some View {
ScrollView {
LazyVStack(alignment: .leading, spacing: SodaSpacing.s32) {
content()
}
.padding(.horizontal, SodaSpacing.s14)
.padding(.top, SodaSpacing.s24)
.padding(.bottom, SodaSpacing.s32)
}
}
private var navigationTitle: String {
if case .canceled = viewModel.renderState {
return "취소 완료"
}
return "선물 상세"
}
private var cancelMessage: String {
let firstLine: String
if case .sent(let model) = viewModel.renderState,
let nickname = model.recipientCreatorNickname?.trimmingCharacters(in: .whitespacesAndNewlines),
!nickname.isEmpty {
firstLine = "\(nickname)에게 보내는 선물을 취소할까요?"
} else {
firstLine = "보내는 선물을 취소할까요?"
}
return firstLine + "\n선물 보내기 규정에 따라 선물 취소 및 사용한 캔이 모두 환불됩니다."
}
}
@@ -0,0 +1,157 @@
import Foundation
import Combine
enum GiftDetailRenderState {
case sent(SentGiftDetailDisplayModel)
case received(ReceivedGiftDetailDisplayModel)
case canceled(SentGiftDetailDisplayModel)
init?(detail: GiftDetailResponse) {
switch GiftDirection(rawValue: detail.direction) {
case .sent:
guard let model = GiftDisplayPolicy.sentDetail(from: detail) else { return nil }
self = model.status == .canceled ? .canceled(model) : .sent(model)
case .received:
guard let model = GiftDisplayPolicy.receivedDetail(from: detail) else { return nil }
self = .received(model)
case nil:
return nil
}
}
}
final class GiftDetailViewModel: ObservableObject {
private let applicationNo: String
private let onCanceled: (String, @escaping (Bool) -> Void) -> Void
private let repository = GiftRepository()
private var subscription: AnyCancellable?
private var cancelSubscription: AnyCancellable?
private var hasCompletedCancellation = false
@Published private(set) var renderState: GiftDetailRenderState?
@Published private(set) var isLoading = false
@Published private(set) var hasLoaded = false
@Published private(set) var isShowingCancelDialog = false
@Published private(set) var isCancelSubmitting = false
@Published private(set) var errorMessage = ""
@Published var isShowPopup = false
init(
applicationNo: String,
onCanceled: @escaping (String, @escaping (Bool) -> Void) -> Void = { _, completion in
completion(true)
}
) {
self.applicationNo = applicationNo
self.onCanceled = onCanceled
}
func presentCancelDialog() {
guard !isLoading, !isCancelSubmitting, !hasCompletedCancellation, canCancel else { return }
errorMessage = ""
isShowPopup = false
isShowingCancelDialog = true
}
func dismissCancelDialog() {
guard !isCancelSubmitting else { return }
isShowingCancelDialog = false
errorMessage = ""
isShowPopup = false
}
func confirmCancel() {
guard isShowingCancelDialog, !isLoading, !isCancelSubmitting, !hasCompletedCancellation, canCancel else { return }
isCancelSubmitting = true
errorMessage = ""
isShowPopup = false
cancelSubscription = repository.cancelGift(applicationNo: applicationNo)
.receive(on: DispatchQueue.main)
.sink { [weak self] result in
guard let self, !self.hasCompletedCancellation else { return }
if case .failure(let error) = result {
self.showCancelError(data: error.response?.data)
}
} receiveValue: { [weak self] response in
guard let self, !self.hasCompletedCancellation else { return }
do {
let decoded = try JSONDecoder().decode(ApiResponseWithoutData.self, from: response.data)
guard decoded.success else {
self.showCancelError(data: response.data)
return
}
self.hasCompletedCancellation = true
self.isShowingCancelDialog = false
self.onCanceled(self.applicationNo) { [weak self] didReplace in
guard let self else { return }
self.isCancelSubmitting = false
guard !didReplace else { return }
self.fetch()
}
} catch {
self.showCancelError(data: response.data)
}
}
}
func fetch() {
guard !isLoading, !isShowingCancelDialog, !isCancelSubmitting else { return }
isLoading = true
errorMessage = ""
isShowPopup = false
subscription = repository.getGift(applicationNo: applicationNo)
.receive(on: DispatchQueue.main)
.sink { [weak self] result in
guard let self else { return }
if case .failure(let error) = result {
self.showError(data: error.response?.data)
}
self.isLoading = false
} receiveValue: { [weak self] response in
guard let self else { return }
do {
let decoded = try JSONDecoder().decode(ApiResponse<GiftDetailResponse>.self, from: response.data)
guard decoded.success, let detail = decoded.data else {
self.showError(data: response.data)
return
}
guard let state = GiftDetailRenderState(detail: detail) else {
self.showError(data: response.data)
return
}
self.renderState = state
self.hasLoaded = true
} catch {
self.showError(data: response.data)
}
}
}
private var canCancel: Bool {
guard case .sent(let detail) = renderState else { return false }
return detail.status == .received
}
private func showCancelError(data: Data?) {
isCancelSubmitting = false
showError(data: data)
}
private func showError(data: Data?) {
struct ErrorResponse: Decodable {
let message: String?
}
let decoded = data.flatMap { try? JSONDecoder().decode(ErrorResponse.self, from: $0) }
let message = decoded?.message?.trimmingCharacters(in: .whitespacesAndNewlines) ?? ""
errorMessage = message.isEmpty ? I18n.Common.commonError : message
isShowPopup = true
}
}
@@ -0,0 +1,100 @@
import SwiftUI
struct GiftBoxCardView: View {
let model: GiftListCardDisplayModel
let onTap: () -> Void
var body: some View {
Button(action: onTap) {
VStack(alignment: .leading, spacing: SodaSpacing.s14) {
HStack(alignment: .top, spacing: SodaSpacing.s8) {
DownsampledKFImage(
url: profileURL,
size: CGSize(width: SodaSpacing.s20, height: SodaSpacing.s20)
)
.background(Color.gray800)
.clipShape(Circle())
.accessibilityHidden(true)
Text(model.counterpartNickname)
.appFont(.caption3)
.foregroundColor(.white)
.fixedSize(horizontal: false, vertical: true)
.frame(maxWidth: .infinity, alignment: .leading)
if let dateText {
Text(dateText)
.appFont(.caption3)
.foregroundColor(.gray500)
.multilineTextAlignment(.trailing)
.fixedSize(horizontal: false, vertical: true)
}
}
.frame(minHeight: SodaSpacing.s20)
HStack(spacing: SodaSpacing.s12) {
VStack(alignment: .leading, spacing: SodaSpacing.s4) {
Text(model.statusDisplay.title)
.appFont(.body4)
.foregroundColor(.white)
if let subtitle {
Text(subtitle)
.appFont(.caption3)
.foregroundColor(.gray400)
}
}
.fixedSize(horizontal: false, vertical: true)
.frame(maxWidth: .infinity, alignment: .leading)
Image("ic_chevron_right")
.resizable()
.renderingMode(.template)
.scaledToFit()
.foregroundColor(.white)
.frame(width: SodaSpacing.s20, height: SodaSpacing.s20)
.accessibilityHidden(true)
}
.frame(minHeight: 39)
}
.multilineTextAlignment(.leading)
.padding(SodaSpacing.s14)
.frame(maxWidth: .infinity, minHeight: 101, alignment: .topLeading)
.background(Color.gray900)
.clipShape(RoundedRectangle(cornerRadius: SodaRadius.r14))
.contentShape(RoundedRectangle(cornerRadius: SodaRadius.r14))
}
.buttonStyle(.plain)
.accessibilityElement(children: .ignore)
.accessibilityLabel(accessibilityText)
.accessibilityAddTraits(.isButton)
.padding(.horizontal, SodaSpacing.s14)
}
private var profileURL: URL? {
guard let text = model.counterpartProfileImageUrl,
!text.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty,
let url = URL(string: text),
let scheme = url.scheme?.lowercased(),
["https", "http"].contains(scheme),
let host = url.host, !host.isEmpty else { return nil }
return url
}
private var dateText: String? {
model.createdDateText.map { "\($0) 신청" }
}
private var subtitle: String? {
model.direction == .sent
? "\(model.sizeName) · \(model.categoryName)"
: model.statusDisplay.subtitle
}
private var accessibilityText: String {
[model.counterpartNickname, dateText, model.statusDisplay.title, subtitle,
model.direction == .received ? "\(model.sizeName) · \(model.categoryName)" : nil]
.compactMap { $0 }
.joined(separator: ", ")
}
}
@@ -0,0 +1,31 @@
import SwiftUI
struct GiftBoxEmptyView: View {
let onFeedback: () -> Void
var body: some View {
VStack(spacing: SodaSpacing.s20) {
Text("전달 예정인 선물이 없어요")
.appFont(.heading1)
.foregroundColor(.white)
Text("베타 기간에는 팬이 선물을 보내는 기능만 제공돼요.\n더 다양해진 선물 기능으로 곧 다시 만나요!")
.appFont(.body3)
.foregroundColor(.gray500)
.fixedSize(horizontal: false, vertical: true)
Button(action: onFeedback) {
Text("의견 남기기")
.appFont(.body2)
.foregroundColor(.white)
.padding(SodaSpacing.s12)
.background(Color.gray800)
.clipShape(Capsule())
}
.buttonStyle(.plain)
}
.multilineTextAlignment(.center)
.frame(maxWidth: .infinity)
.padding(SodaSpacing.s14)
}
}
@@ -0,0 +1,30 @@
import SwiftUI
struct GiftBoxInfoBannerView: View {
let direction: GiftDirection
var body: some View {
VStack(alignment: .leading, spacing: SodaSpacing.s8) {
HStack(spacing: SodaSpacing.s6) {
Image(systemName: "info.circle")
.accessibilityHidden(true)
Text(direction == .received ? "배송지 입력 기간 안내" : "사서함을 통해 안전하게 전달됩니다")
.appFont(.body4)
}
.foregroundColor(.white)
Text(direction == .received
? "알림을 받은 날부터 7일 이내에 배송지를 입력해 주세요. 기한 내 입력하지 않으면 선물이 반송됩니다."
: "크리에이터 및 팬의 주소는 공개되지 않습니다. 선물은 소다라이브 사서함에 도착한 뒤 크리에이터에게 전달됩니다.")
.appFont(.caption3)
.foregroundColor(.gray500)
.fixedSize(horizontal: false, vertical: true)
}
.padding(SodaSpacing.s14)
.frame(maxWidth: .infinity, alignment: .leading)
.background(Color.gray900)
.clipShape(RoundedRectangle(cornerRadius: SodaRadius.r14))
.accessibilityElement(children: .combine)
.padding(.horizontal, SodaSpacing.s14)
}
}
@@ -0,0 +1,78 @@
import SwiftUI
struct GiftBoxListView: View {
@StateObject private var viewModel = GiftBoxListViewModel()
@State private var hasAppeared = false
var body: some View {
VStack(spacing: 0) {
DetailNavigationBar(title: "선물함")
.frame(height: 54)
BaseView(isLoading: .constant(viewModel.isLoading)) {
GeometryReader { geometry in
ScrollView {
if viewModel.hasLoaded {
if viewModel.items.isEmpty && isCreator {
GiftBoxEmptyView {
AppState.shared.setAppStep(step: GiftConstants.feedbackStep)
}
.frame(minHeight: geometry.size.height)
} else {
listContent
}
}
}
.refreshable { await viewModel.refresh() }
}
}
.sodaToast(isPresented: $viewModel.isShowPopup, message: viewModel.errorMessage)
}
.background(Color.black.ignoresSafeArea())
.onAppear {
guard !hasAppeared else { return }
hasAppeared = true
viewModel.fetchInitialPage()
}
}
private var isCreator: Bool {
UserDefaults.string(forKey: .role) == MemberRole.CREATOR.rawValue
}
private var listContent: some View {
VStack(spacing: SodaSpacing.s12) {
GiftBoxInfoBannerView(direction: viewModel.items.contains {
GiftDisplayPolicy.listCard(from: $0)?.direction == .received
} ? .received : .sent)
LazyVStack(spacing: 0) {
LazyVStack(spacing: SodaSpacing.s8) {
ForEach(viewModel.items, id: \.applicationNo) { item in
if let model = GiftDisplayPolicy.listCard(from: item) {
GiftBoxCardView(model: model) {
AppState.shared.setAppStep(step: .giftDetail(applicationNo: model.applicationNo))
}
}
}
if viewModel.isLoadingMore {
ProgressView()
.tint(.white)
.padding(SodaSpacing.s14)
}
}
if let lastItem = viewModel.items.last {
Color.clear
.frame(height: 1)
.allowsHitTesting(false)
.accessibilityHidden(true)
.id(lastItem.applicationNo)
.onAppear { viewModel.fetchNextPage(currentItem: lastItem) }
}
}
}
.padding(.top, SodaSpacing.s8)
.padding(.bottom, SodaSpacing.s14)
}
}
@@ -0,0 +1,102 @@
import Foundation
import Combine
final class GiftBoxListViewModel: ObservableObject {
private let repository = GiftRepository()
private let pageSize = 20
private var subscription: AnyCancellable?
private var page = 0
private var isRequestInFlight = false
@Published private(set) var items = [GiftListItemResponse]()
@Published private(set) var totalCount = 0
@Published private(set) var hasNext = false
@Published private(set) var hasLoaded = false
@Published private(set) var isLoading = false
@Published private(set) var isLoadingMore = false
@Published private(set) var isRefreshing = false
@Published private(set) var errorMessage = ""
@Published var isShowPopup = false
func fetchInitialPage() {
guard !hasLoaded else { return }
fetch(page: 0)
}
func fetchNextPage(currentItem: GiftListItemResponse) {
guard hasLoaded, hasNext,
currentItem.applicationNo == items.last?.applicationNo else { return }
fetch(page: page + 1)
}
@MainActor
func refresh() async {
await withCheckedContinuation { continuation in
fetch(page: 0, isRefresh: true) {
continuation.resume()
}
}
}
private func fetch(page requestedPage: Int, isRefresh: Bool = false, completion: (() -> Void)? = nil) {
guard !isRequestInFlight else {
completion?()
return
}
isRequestInFlight = true
isLoading = requestedPage == 0 && !isRefresh
isLoadingMore = requestedPage > 0
isRefreshing = isRefresh
errorMessage = ""
isShowPopup = false
subscription = repository.getGifts(page: requestedPage, size: pageSize)
.receive(on: DispatchQueue.main)
.sink { [weak self] result in
defer { completion?() }
guard let self else { return }
if case .failure(let error) = result {
self.showError(data: error.response?.data)
}
self.isLoading = false
self.isLoadingMore = false
self.isRefreshing = false
self.isRequestInFlight = false
} receiveValue: { [weak self] response in
guard let self else { return }
do {
let decoded = try JSONDecoder().decode(ApiResponse<GiftListResponse>.self, from: response.data)
guard decoded.success, let data = decoded.data else {
self.showError(data: response.data)
return
}
if requestedPage == 0 {
self.items = data.items
} else {
self.items.append(contentsOf: data.items)
}
self.page = data.page
self.totalCount = data.totalCount
self.hasNext = data.hasNext
self.hasLoaded = true
} catch {
self.showError(data: response.data)
}
}
}
private func showError(data: Data?) {
struct ErrorResponse: Decodable {
let message: String?
}
let decoded = data.flatMap { try? JSONDecoder().decode(ErrorResponse.self, from: $0) }
let message = decoded?.message?.trimmingCharacters(in: .whitespacesAndNewlines) ?? ""
errorMessage = message.isEmpty ? I18n.Common.commonError : message
isShowPopup = true
}
}
@@ -0,0 +1,105 @@
import Foundation
enum GiftDirection: String, Decodable {
case sent = "SENT"
case received = "RECEIVED"
}
enum GiftStatus: String, Decodable, CaseIterable {
case received = "RECEIVED"
case trackingRegistered = "TRACKING_REGISTERED"
case arrivedAtMailbox = "ARRIVED_AT_MAILBOX"
case inspectionCompleted = "INSPECTION_COMPLETED"
case delivered = "DELIVERED"
case undeliverable = "UNDELIVERABLE"
case canceled = "CANCELED"
}
enum GiftProgressStep: String, CaseIterable {
case received = "RECEIVED"
case trackingRegistered = "TRACKING_REGISTERED"
case arrivedAtMailbox = "ARRIVED_AT_MAILBOX"
case inspectionCompleted = "INSPECTION_COMPLETED"
case delivered = "DELIVERED"
var title: String {
switch self {
case .received:
return "신청 접수"
case .trackingRegistered:
return "발송 확인"
case .arrivedAtMailbox:
return "사서함 도착"
case .inspectionCompleted:
return "검수 완료"
case .delivered:
return "전달 완료"
}
}
}
enum GiftSize: String, Decodable {
case small = "SMALL"
case medium = "MEDIUM"
case large = "LARGE"
}
struct GiftListStatusDisplayModel {
let title: String
let subtitle: String?
}
struct GiftListCardDisplayModel {
let applicationNo: String
let direction: GiftDirection
let status: GiftStatus
let counterpartNickname: String
let counterpartProfileImageUrl: String?
let categoryName: String
let sizeName: String
let createdDateText: String?
let statusDisplay: GiftListStatusDisplayModel
}
struct GiftProgressDisplayModel {
let step: GiftProgressStep
let occurredDateText: String?
}
struct GiftAddressDisplayModel {
let name: String
let phoneNumber: String
let address: String
}
struct SentGiftDetailDisplayModel {
let status: GiftStatus
let statusName: String
let undeliverableReason: String?
let recipientCreatorNickname: String?
let sizeName: String
let categoryName: String
let applicationNo: String
let paidCan: Int?
let tracking: String?
let shippingRequestedDateText: String?
let applicationDateText: String?
let canceledDateText: String?
let senderInfo: GiftAddressDisplayModel?
let mailbox: GiftAddressDisplayModel?
let trackingRequired: Bool
let progress: [GiftProgressDisplayModel]
}
struct ReceivedGiftDetailDisplayModel {
let status: GiftStatus
let statusName: String
let undeliverableReason: String?
let senderNickname: String?
let sizeName: String
let categoryName: String
let shippingRequestedDateText: String?
let recipientAddressRequired: Bool
let recipientAddress: GiftAddressDisplayModel?
let progress: [GiftProgressDisplayModel]
}
@@ -0,0 +1,164 @@
import Foundation
enum GiftDateFormatter {
static func yyyyMMdd(fromUTC text: String?) -> String? {
format(text, format: "yyyy.MM.dd")
}
static func mmDD(fromUTC text: String?) -> String? {
format(text, format: "MM.dd")
}
private static func format(_ text: String?, format: String) -> String? {
guard let text, let date = DateParser.parse(text) else { return nil }
let formatter = DateFormatter()
formatter.locale = Locale(identifier: "en_US_POSIX")
formatter.timeZone = .autoupdatingCurrent
formatter.dateFormat = format
return formatter.string(from: date)
}
}
enum GiftDisplayPolicy {
static func listCard(from item: GiftListItemResponse) -> GiftListCardDisplayModel? {
guard let direction = GiftDirection(rawValue: item.direction),
let status = GiftStatus(rawValue: item.status) else {
return nil
}
return GiftListCardDisplayModel(
applicationNo: item.applicationNo,
direction: direction,
status: status,
counterpartNickname: item.counterpartNickname,
counterpartProfileImageUrl: item.counterpartProfileImageUrl,
categoryName: item.categoryName,
sizeName: item.sizeName,
createdDateText: GiftDateFormatter.yyyyMMdd(fromUTC: item.createdAt),
statusDisplay: listStatus(direction: direction, status: status, statusName: item.statusName)
)
}
static func sentDetail(from detail: GiftDetailResponse) -> SentGiftDetailDisplayModel? {
guard let status = status(from: detail, expectedDirection: .sent) else { return nil }
return SentGiftDetailDisplayModel(
status: status,
statusName: detail.statusName,
undeliverableReason: detail.delivery.undeliverableReason,
recipientCreatorNickname: detail.giftInfo.recipientCreatorNickname,
sizeName: detail.giftInfo.sizeName,
categoryName: detail.giftInfo.categoryName,
applicationNo: detail.applicationNo,
paidCan: detail.giftInfo.paidCan,
tracking: detail.giftInfo.tracking,
shippingRequestedDateText: GiftDateFormatter.yyyyMMdd(fromUTC: detail.giftInfo.shippingRequestedAt),
applicationDateText: GiftDateFormatter.yyyyMMdd(
fromUTC: detail.statusTimeline.first { $0.status == GiftStatus.received.rawValue }?.occurredAt
),
canceledDateText: GiftDateFormatter.yyyyMMdd(fromUTC: detail.delivery.canceledAt),
senderInfo: detail.senderInfo.map(GiftAddressDisplayModel.init),
mailbox: detail.mailbox.map(GiftAddressDisplayModel.init),
trackingRequired: detail.trackingRequired,
progress: progress(from: detail.statusTimeline)
)
}
static func receivedDetail(from detail: GiftDetailResponse) -> ReceivedGiftDetailDisplayModel? {
guard let status = status(from: detail, expectedDirection: .received) else { return nil }
return ReceivedGiftDetailDisplayModel(
status: status,
statusName: detail.statusName,
undeliverableReason: detail.delivery.undeliverableReason,
senderNickname: detail.giftInfo.senderNickname,
sizeName: detail.giftInfo.sizeName,
categoryName: detail.giftInfo.categoryName,
shippingRequestedDateText: GiftDateFormatter.yyyyMMdd(fromUTC: detail.giftInfo.shippingRequestedAt),
recipientAddressRequired: status == .undeliverable ? false : detail.recipientAddressRequired,
recipientAddress: status == .undeliverable ? nil : detail.recipientAddress.map(GiftAddressDisplayModel.init),
progress: progress(from: detail.statusTimeline)
)
}
static func sizeDescription(for sizeCode: String) -> String? {
guard let size = GiftSize(rawValue: sizeCode) else { return nil }
switch size {
case .small:
return "세 변의 합 100cm 이하 · 5kg 이하"
case .medium:
return "세 변의 합 120cm 이하 · 15kg 이하"
case .large:
return "세 변의 합 160cm 이하 · 20kg 이하"
}
}
private static func listStatus(
direction: GiftDirection,
status: GiftStatus,
statusName: String
) -> GiftListStatusDisplayModel {
switch (direction, status) {
case (.sent, .received):
return GiftListStatusDisplayModel(title: "운송장 등록 필요", subtitle: nil)
case (.sent, .trackingRegistered):
return GiftListStatusDisplayModel(title: "발송 확인", subtitle: nil)
case (.sent, .arrivedAtMailbox):
return GiftListStatusDisplayModel(title: "사서함 도착", subtitle: nil)
case (.sent, .inspectionCompleted):
return GiftListStatusDisplayModel(title: "선물 검수 완료", subtitle: nil)
case (.sent, .delivered):
return GiftListStatusDisplayModel(title: "전달 완료", subtitle: nil)
case (.sent, .undeliverable):
return GiftListStatusDisplayModel(title: "전달 불가", subtitle: nil)
case (.sent, .canceled):
return GiftListStatusDisplayModel(title: "신청 취소", subtitle: nil)
case (.received, .trackingRegistered):
return GiftListStatusDisplayModel(title: "배송지 입력 필요", subtitle: "전달 예정")
case (.received, .arrivedAtMailbox):
return GiftListStatusDisplayModel(title: "선물 검수", subtitle: "선물 확인 중")
case (.received, .inspectionCompleted):
return GiftListStatusDisplayModel(title: "선물 검수 완료", subtitle: "배송 중")
case (.received, .delivered):
return GiftListStatusDisplayModel(title: "전달 완료", subtitle: nil)
case (.received, .undeliverable):
return GiftListStatusDisplayModel(title: "전달 불가", subtitle: nil)
default:
return GiftListStatusDisplayModel(title: statusName, subtitle: nil)
}
}
private static func status(
from detail: GiftDetailResponse,
expectedDirection: GiftDirection
) -> GiftStatus? {
guard GiftDirection(rawValue: detail.direction) == expectedDirection else { return nil }
return GiftStatus(rawValue: detail.status)
}
private static func progress(from timeline: [GiftStatusTimelineResponse]) -> [GiftProgressDisplayModel] {
GiftProgressStep.allCases.map { step in
let occurredAt = timeline.first { $0.status == step.rawValue }?.occurredAt
return GiftProgressDisplayModel(
step: step,
occurredDateText: GiftDateFormatter.mmDD(fromUTC: occurredAt)
)
}
}
}
private extension GiftAddressDisplayModel {
init(_ senderInfo: GiftSenderInfoResponse) {
self.init(name: senderInfo.name, phoneNumber: senderInfo.phoneNumber, address: senderInfo.address)
}
init(_ recipientAddress: GiftRecipientAddressResponse) {
self.init(name: recipientAddress.name, phoneNumber: recipientAddress.phoneNumber, address: recipientAddress.address)
}
init(_ mailbox: GiftMailboxResponse) {
self.init(name: mailbox.name, phoneNumber: mailbox.phoneNumber, address: mailbox.address)
}
}
@@ -0,0 +1,135 @@
import Foundation
struct GiftFormOptionsResponse: Decodable {
let sizes: [GiftSizeOptionResponse]
let categories: [GiftCategoryOptionResponse]
}
struct GiftSizeOptionResponse: Decodable {
let sizeCode: String
let name: String
let basePriceCan: Int
let salePriceCan: Int
}
struct GiftCategoryOptionResponse: Decodable {
let categoryId: Int
let name: String
let requiresDamageWaiver: Bool
}
struct CreateGiftRequest: Encodable {
let recipientMemberId: Int
let senderName: String
let senderPhoneNumber: String
let senderZipCode: String
let senderAddress: String
let senderAddressDetail: String
let sizeCode: String
let categoryId: Int
let senderTermsAgreed: Bool
let senderPrivacyAgreed: Bool
let damageWaiverAgreed: Bool
}
struct CreateGiftResponse: Decodable {
let applicationNo: String
let status: String
let statusName: String
let priceCan: Int
let trackingDeadlineAt: String
}
struct GiftListResponse: Decodable {
let totalCount: Int
let items: [GiftListItemResponse]
let page: Int
let size: Int
let hasNext: Bool
}
struct GiftListItemResponse: Decodable {
let applicationNo: String
let direction: String
let status: String
let statusName: String
let priceCan: Int
let categoryName: String
let sizeName: String
let counterpartMemberId: Int
let counterpartNickname: String
let counterpartProfileImageUrl: String?
let createdAt: String
}
struct GiftDetailResponse: Decodable {
let applicationNo: String
let direction: String
let status: String
let statusName: String
let giftInfo: GiftInfoResponse
let senderInfo: GiftSenderInfoResponse?
let recipientAddress: GiftRecipientAddressResponse?
let mailbox: GiftMailboxResponse?
let trackingRequired: Bool
let recipientAddressRequired: Bool
let recipientAddressDeadlineAt: String?
let delivery: GiftDeliveryResponse
let statusTimeline: [GiftStatusTimelineResponse]
}
struct GiftInfoResponse: Decodable {
let recipientCreatorNickname: String?
let senderNickname: String?
let sizeName: String
let categoryName: String
let applicationNo: String?
let paidCan: Int?
let tracking: String?
let shippingRequestedAt: String?
}
struct GiftSenderInfoResponse: Decodable {
let name: String
let phoneNumber: String
let address: String
}
struct GiftRecipientAddressResponse: Decodable {
let name: String
let phoneNumber: String
let address: String
}
struct GiftMailboxResponse: Decodable {
let name: String
let address: String
let phoneNumber: String
}
struct GiftDeliveryResponse: Decodable {
let canceledAt: String?
let undeliverableAt: String?
let undeliverableReason: String?
}
struct GiftStatusTimelineResponse: Decodable {
let status: String
let statusName: String
let occurredAt: String?
}
struct RegisterGiftTrackingRequest: Encodable {
let courierCompanyName: String
let trackingNumber: String
}
struct SubmitGiftRecipientAddressRequest: Encodable {
let recipientName: String
let recipientPhoneNumber: String
let recipientZipCode: String
let recipientAddress: String
let recipientAddressDetail: String
let recipientTermsAgreed: Bool
let recipientPrivacyAgreed: Bool
}
@@ -0,0 +1,112 @@
import SwiftUI
struct GiftRecipientAddressFormView: View {
let model: ReceivedGiftDetailDisplayModel
@ObservedObject var viewModel: GiftRecipientAddressViewModel
var body: some View {
ScrollView {
VStack(alignment: .leading, spacing: SodaSpacing.s32) {
privacyBanner
GiftInfoSectionView(title: "전달 예정 선물") {
if let nickname = model.senderNickname {
GiftInfoRow(title: "보낸 사람", value: nickname)
}
GiftInfoRow(title: "선물 사이즈", value: model.sizeName)
GiftInfoRow(title: "카테고리", value: model.categoryName)
}
addressSection
agreementsSection
}
.frame(maxWidth: .infinity, alignment: .leading)
.padding(.horizontal, SodaSpacing.s14)
.padding(.top, SodaSpacing.s24)
.padding(.bottom, SodaSpacing.s32)
}
.scrollDismissesKeyboard(.interactively)
.safeAreaInset(edge: .bottom, spacing: 0) {
Button {
viewModel.submit()
} label: {
SelectedButtonView(title: "배송지 입력 완료", isActive: viewModel.canSubmit, isSelected: false)
}
.disabled(!viewModel.canSubmit)
.padding(SodaSpacing.s14)
.background(Color.black)
}
.disabled(viewModel.isSubmitting || viewModel.hasSubmitted)
}
private var privacyBanner: some View {
Text("필요 정보 외의 용도로 사용하지 않으며, 전달이 완료되면 파기됩니다")
.appFont(.caption3)
.foregroundColor(.gray500)
.fixedSize(horizontal: false, vertical: true)
.padding(SodaSpacing.s14)
.frame(maxWidth: .infinity, alignment: .leading)
.background(Color.gray900)
.clipShape(RoundedRectangle(cornerRadius: SodaRadius.r14))
}
private var addressSection: some View {
VStack(alignment: .leading, spacing: SodaSpacing.s20) {
VStack(alignment: .leading, spacing: SodaSpacing.s4) {
Text("배송지 입력")
.appFont(.heading3)
.foregroundColor(.white)
.accessibilityAddTraits(.isHeader)
Text("제출 후 수정할 수 없으니 입력한 정보를 다시 한번 확인해 주세요")
.appFont(.caption3)
.foregroundColor(.gray500)
.fixedSize(horizontal: false, vertical: true)
}
field("이름", helper: "입력한 이름으로 선물이 전달돼요") {
GiftContactTextField(text: $viewModel.recipientName, rule: .name)
}
field("휴대폰 번호", helper: "문제 발생 시 연락이 가능한 번호를 입력해 주세요") {
GiftContactTextField(text: $viewModel.recipientPhoneNumber, rule: .phoneNumber)
}
SodaAddressInputView(zipCode: $viewModel.recipientZipCode, address: $viewModel.recipientAddress,
addressDetail: $viewModel.recipientAddressDetail)
}
.frame(maxWidth: .infinity, alignment: .leading)
}
private var agreementsSection: some View {
VStack(alignment: .leading, spacing: SodaSpacing.s16) {
Text("이용 약관 동의")
.appFont(.heading3)
.foregroundColor(.white)
.accessibilityAddTraits(.isHeader)
GiftAgreementRow(title: "소다라이브 크리에이터 선물 받기 이용약관에 동의합니다.",
isAgreed: $viewModel.recipientTermsAgreed)
GiftAgreementRow(title: "선물 받기를 위한 개인정보 수집·이용에 동의합니다.",
isAgreed: $viewModel.recipientPrivacyAgreed)
}
.frame(maxWidth: .infinity, alignment: .leading)
}
private func field<Content: View>(
_ title: String,
helper: String,
@ViewBuilder content: () -> Content
) -> some View {
VStack(alignment: .leading, spacing: SodaSpacing.s4) {
Text(title)
.appFont(.body5)
.foregroundColor(.grayee)
content()
.appFont(.body3)
.foregroundColor(.white)
.padding(SodaSpacing.s14)
.background(Color.gray900)
.cornerRadius(SodaRadius.r14)
.accessibilityLabel(title)
Text(helper)
.appFont(.caption3)
.foregroundColor(.gray500)
.fixedSize(horizontal: false, vertical: true)
}
.frame(maxWidth: .infinity, alignment: .leading)
}
}
@@ -0,0 +1,98 @@
import Combine
import Foundation
final class GiftRecipientAddressViewModel: ObservableObject {
@Published var recipientName: String = ""
@Published var recipientPhoneNumber: String = ""
@Published var recipientZipCode: String = ""
@Published var recipientAddress: String = ""
@Published var recipientAddressDetail: String = ""
@Published var recipientTermsAgreed: Bool = false
@Published var recipientPrivacyAgreed: Bool = false
@Published private(set) var isSubmitting = false
@Published var errorMessage = ""
@Published var isShowPopup = false
@Published var isShowSuccessToast = false
let successMessage = "배송지 입력 완료"
private let applicationNo: String
private let onSubmitted: () -> Void
private let repository = GiftRepository()
private var mutationSubscription: AnyCancellable?
@Published private(set) var hasSubmitted = false
private var hasNotifiedSubmission = false
init(applicationNo: String, onSubmitted: @escaping () -> Void) {
self.applicationNo = applicationNo
self.onSubmitted = onSubmitted
}
var canSubmit: Bool {
!isSubmitting && !hasSubmitted && recipientTermsAgreed && recipientPrivacyAgreed
&& GiftContactInputRule.name.acceptsSubmission(recipientName)
&& GiftContactInputRule.phoneNumber.acceptsSubmission(recipientPhoneNumber)
&& [recipientZipCode, recipientAddress].allSatisfy {
!$0.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty
}
}
func submit() {
guard canSubmit else { return }
isSubmitting = true
errorMessage = ""
isShowPopup = false
let request = SubmitGiftRecipientAddressRequest(
recipientName: recipientName.trimmingCharacters(in: .whitespacesAndNewlines),
recipientPhoneNumber: recipientPhoneNumber.trimmingCharacters(in: .whitespacesAndNewlines),
recipientZipCode: recipientZipCode.trimmingCharacters(in: .whitespacesAndNewlines),
recipientAddress: recipientAddress.trimmingCharacters(in: .whitespacesAndNewlines),
recipientAddressDetail: recipientAddressDetail.trimmingCharacters(in: .whitespacesAndNewlines),
recipientTermsAgreed: recipientTermsAgreed,
recipientPrivacyAgreed: recipientPrivacyAgreed
)
mutationSubscription = repository.submitRecipientAddress(applicationNo: applicationNo, request: request)
.receive(on: DispatchQueue.main)
.sink { [weak self] result in
guard let self, !self.hasSubmitted else { return }
if case .failure(let error) = result {
self.finishFailure(data: error.response?.data)
}
} receiveValue: { [weak self] response in
guard let self, !self.hasSubmitted else { return }
do {
let decoded = try JSONDecoder().decode(ApiResponseWithoutData.self, from: response.data)
guard decoded.success else {
self.finishFailure(data: response.data)
return
}
self.hasSubmitted = true
self.isSubmitting = false
self.isShowSuccessToast = true
} catch {
self.finishFailure(data: response.data)
}
}
}
func successToastDidDismiss() {
guard hasSubmitted, !isShowSuccessToast, !hasNotifiedSubmission else { return }
hasNotifiedSubmission = true
onSubmitted()
}
private func finishFailure(data: Data?) {
struct ErrorResponse: Decodable {
let message: String?
}
let decoded = data.flatMap { try? JSONDecoder().decode(ErrorResponse.self, from: $0) }
let message = decoded?.message?.trimmingCharacters(in: .whitespacesAndNewlines) ?? ""
isSubmitting = false
errorMessage = message.isEmpty ? I18n.Common.commonError : message
isShowPopup = true
}
}
@@ -0,0 +1,71 @@
import Foundation
import Moya
enum GiftApi {
case getFormOptions
case create(request: CreateGiftRequest)
case getGifts(page: Int, size: Int)
case getGift(applicationNo: String)
case cancel(applicationNo: String)
case registerTracking(applicationNo: String, request: RegisterGiftTrackingRequest)
case submitRecipientAddress(applicationNo: String, request: SubmitGiftRecipientAddressRequest)
}
extension GiftApi: TargetType {
var baseURL: URL {
return URL(string: BASE_URL)!
}
var path: String {
switch self {
case .getFormOptions:
return "/api/v2/gifts/form-options"
case .create, .getGifts:
return "/api/v2/gifts"
case .getGift(let applicationNo):
return "/api/v2/gifts/\(applicationNo)"
case .cancel(let applicationNo):
return "/api/v2/gifts/\(applicationNo)/cancel"
case .registerTracking(let applicationNo, _):
return "/api/v2/gifts/\(applicationNo)/tracking"
case .submitRecipientAddress(let applicationNo, _):
return "/api/v2/gifts/\(applicationNo)/recipient-address"
}
}
var method: Moya.Method {
switch self {
case .getFormOptions, .getGifts, .getGift:
return .get
case .create, .cancel, .registerTracking, .submitRecipientAddress:
return .post
}
}
var task: Moya.Task {
switch self {
case .getFormOptions, .getGift, .cancel:
return .requestPlain
case .create(let request):
return .requestJSONEncodable(request)
case .getGifts(let page, let size):
return .requestParameters(
parameters: [
"type": "ALL",
"page": page,
"size": size
],
encoding: URLEncoding.queryString
)
case .registerTracking(_, let request):
return .requestJSONEncodable(request)
case .submitRecipientAddress(_, let request):
return .requestJSONEncodable(request)
}
}
var headers: [String: String]? {
return ["Authorization": "Bearer \(UserDefaults.string(forKey: UserDefaultsKey.token))"]
}
}
@@ -0,0 +1,43 @@
import Foundation
import Combine
import CombineMoya
import Moya
final class GiftRepository {
private let api = MoyaProvider<GiftApi>()
func getFormOptions() -> AnyPublisher<Response, MoyaError> {
return api.requestPublisher(.getFormOptions)
}
func createGift(request: CreateGiftRequest) -> AnyPublisher<Response, MoyaError> {
return api.requestPublisher(.create(request: request))
}
func getGifts(page: Int, size: Int) -> AnyPublisher<Response, MoyaError> {
return api.requestPublisher(.getGifts(page: page, size: size))
}
func getGift(applicationNo: String) -> AnyPublisher<Response, MoyaError> {
return api.requestPublisher(.getGift(applicationNo: applicationNo))
}
func cancelGift(applicationNo: String) -> AnyPublisher<Response, MoyaError> {
return api.requestPublisher(.cancel(applicationNo: applicationNo))
}
func registerTracking(
applicationNo: String,
request: RegisterGiftTrackingRequest
) -> AnyPublisher<Response, MoyaError> {
return api.requestPublisher(.registerTracking(applicationNo: applicationNo, request: request))
}
func submitRecipientAddress(
applicationNo: String,
request: SubmitGiftRecipientAddressRequest
) -> AnyPublisher<Response, MoyaError> {
return api.requestPublisher(.submitRecipientAddress(applicationNo: applicationNo, request: request))
}
}
@@ -0,0 +1,19 @@
import SwiftUI
struct GiftSendBannerView: View {
var body: some View {
VStack(alignment: .leading, spacing: SodaSpacing.s8) {
Text("선물 보내기 베타 서비스 안내")
.appFont(size: 14, weight: .bold)
.foregroundColor(.soda400)
Text("베타 기간 동안은 일부 기능만 제공됩니다. 크리에이터에게 마음을 잘 전할 수 있도록 더 넓어진 선물 보내기로 곧 다시 만나요!")
.appFont(size: 12, weight: .regular)
.foregroundColor(.gray300)
.fixedSize(horizontal: false, vertical: true)
}
.padding(SodaSpacing.s14)
.frame(maxWidth: .infinity, alignment: .leading)
.background(Color.gray900)
.cornerRadius(SodaRadius.r8)
}
}
@@ -0,0 +1,53 @@
import SwiftUI
struct GiftSenderFormView: View {
@Binding var name: String
@Binding var phoneNumber: String
@Binding var zipCode: String
@Binding var address: String
@Binding var addressDetail: String
var body: some View {
VStack(alignment: .leading, spacing: SodaSpacing.s20) {
VStack(alignment: .leading, spacing: SodaSpacing.s4) {
Text("보내는 사람")
.appFont(.heading3)
.foregroundColor(.white)
Text("발송 확인 외의 용도로 사용하지 않으며, 전달이 완료되면 파기됩니다")
.appFont(.caption3)
.foregroundColor(.gray500)
.fixedSize(horizontal: false, vertical: true)
}
field("이름", helper: "택배 발송 시 이름과 동일하게 적어주세요") {
GiftContactTextField(text: $name, rule: .name)
}
field("휴대폰 번호", helper: "문제 발생 시 연락이 가능한 번호를 입력해 주세요") {
GiftContactTextField(text: $phoneNumber, rule: .phoneNumber)
}
SodaAddressInputView(zipCode: $zipCode, address: $address, addressDetail: $addressDetail)
}
}
private func field<Content: View>(
_ title: String,
helper: String,
@ViewBuilder content: () -> Content
) -> some View {
VStack(alignment: .leading, spacing: SodaSpacing.s4) {
Text(title)
.appFont(.body5)
.foregroundColor(.grayee)
content()
.appFont(.body3)
.foregroundColor(.white)
.padding(SodaSpacing.s14)
.background(Color.gray900)
.cornerRadius(SodaRadius.r14)
.accessibilityLabel(title)
Text(helper)
.appFont(.caption3)
.foregroundColor(.gray500)
.fixedSize(horizontal: false, vertical: true)
}
}
}
@@ -0,0 +1,221 @@
import SwiftUI
struct GiftSendView: View {
private let recipientCreatorProfileImageUrl: String
@StateObject private var viewModel: GiftSendViewModel
@State private var hasAppeared = false
init(recipientMemberId: Int, recipientCreatorNickname: String, recipientCreatorProfileImageUrl: String) {
self.recipientCreatorProfileImageUrl = recipientCreatorProfileImageUrl
_viewModel = StateObject(wrappedValue: GiftSendViewModel(
recipientMemberId: recipientMemberId,
recipientCreatorNickname: recipientCreatorNickname,
onCreated: { applicationNo in
AppState.shared.replaceCurrentAppStep(
step: .giftDetail(applicationNo: applicationNo),
ifCurrentStep: { step in
guard case .giftSend(let memberId, let nickname, _) = step else { return false }
return memberId == recipientMemberId && nickname == recipientCreatorNickname
}
)
}
))
}
var body: some View {
VStack(spacing: 0) {
DetailNavigationBar(title: "선물 보내기")
.frame(height: 54)
.allowsHitTesting(!viewModel.isSubmitting)
BaseView(isLoading: .constant(viewModel.isLoading || viewModel.isSubmitting)) {
ScrollView {
VStack(alignment: .leading, spacing: SodaSpacing.s24) {
GiftSendBannerView()
recipientSection
sectionDivider
sizeSection
categorySection
sectionDivider
GiftSenderFormView(
name: $viewModel.senderName,
phoneNumber: $viewModel.senderPhoneNumber,
zipCode: $viewModel.senderZipCode,
address: $viewModel.senderAddress,
addressDetail: $viewModel.senderAddressDetail
)
sectionDivider
agreementsSection
}
.padding(.horizontal, SodaSpacing.s14)
.padding(.vertical, SodaSpacing.s16)
}
.scrollDismissesKeyboard(.interactively)
.safeAreaInset(edge: .bottom, spacing: 0) {
Button {
viewModel.submitGift()
} label: {
SelectedButtonView(
title: viewModel.selectedSize.map { "\($0.salePriceCan)캔으로 선물 보내기" } ?? "선물 보내기",
isActive: viewModel.canSubmit,
isSelected: false
)
}
.disabled(!viewModel.canSubmit)
.padding(SodaSpacing.s14)
.background(Color.black)
}
}
.sodaToast(isPresented: $viewModel.isShowPopup, message: viewModel.errorMessage)
}
.background(Color.black)
.onAppear {
guard !hasAppeared else { return }
hasAppeared = true
viewModel.fetchFormOptions()
}
}
private var recipientSection: some View {
VStack(alignment: .leading, spacing: SodaSpacing.s14) {
sectionTitle("받는 크리에이터")
HStack(spacing: SodaSpacing.s12) {
DownsampledKFImage(url: URL(string: recipientCreatorProfileImageUrl), size: CGSize(width: 38, height: 38))
.clipShape(Circle())
.accessibilityHidden(true)
Text(viewModel.recipientCreatorNickname)
.appFont(size: 16, weight: .bold)
.foregroundColor(.white)
Spacer(minLength: 0)
}
.padding(SodaSpacing.s14)
.background(Color.gray900)
.cornerRadius(SodaRadius.r8)
}
}
private var sizeSection: some View {
VStack(alignment: .leading, spacing: SodaSpacing.s12) {
sectionTitle("선물 사이즈")
helper("시작은 부담 없이 작은 크기를 선택해 주세요")
ForEach(viewModel.sizes, id: \.sizeCode) { size in
Button {
viewModel.selectedSize = size
} label: {
HStack(spacing: SodaSpacing.s12) {
VStack(alignment: .leading, spacing: SodaSpacing.s6) {
Text(sizeTitle(size.sizeCode))
.appFont(size: 16, weight: .bold)
.foregroundColor(.white)
if let description = GiftDisplayPolicy.sizeDescription(for: size.sizeCode) {
helper(description)
}
}
Spacer(minLength: 0)
VStack(alignment: .trailing, spacing: SodaSpacing.s4) {
if size.basePriceCan != size.salePriceCan {
Text("\(size.basePriceCan)캔")
.strikethrough()
.appFont(size: 12, weight: .regular)
.foregroundColor(.gray500)
}
Text("\(size.salePriceCan)캔")
.appFont(size: 16, weight: .bold)
.foregroundColor(.soda400)
}
}
.padding(SodaSpacing.s16)
.frame(minHeight: 77)
.background(Color.gray900)
.cornerRadius(SodaRadius.r8)
.overlay(RoundedRectangle(cornerRadius: SodaRadius.r8)
.stroke(viewModel.selectedSize?.sizeCode == size.sizeCode ? Color.soda400 : .clear, lineWidth: 1))
}
.buttonStyle(.plain)
.accessibilityAddTraits(viewModel.selectedSize?.sizeCode == size.sizeCode ? .isSelected : [])
}
}
}
private var categorySection: some View {
VStack(alignment: .leading, spacing: SodaSpacing.s12) {
sectionTitle("카테고리")
helper("택배 기간에는 제한되는 카테고리의 특별한 점들을 꼭 확인합니다")
Menu {
ForEach(viewModel.categories, id: \.categoryId) { category in
Button(category.name) { viewModel.selectCategory(category) }
}
} label: {
HStack {
Text(viewModel.selectedCategory?.name ?? "카테고리 선택")
.appFont(.body3)
Spacer()
Image(systemName: "chevron.down")
}
.foregroundColor(viewModel.selectedCategory == nil ? .gray500 : .white)
.padding(SodaSpacing.s14)
.background(Color.gray900)
.cornerRadius(SodaRadius.r14)
}
.disabled(viewModel.categories.isEmpty)
if viewModel.selectedCategory?.requiresDamageWaiver == true {
GiftAgreementRow(title: "파손 및 분실 면책 사항에 동의합니다.", isAgreed: $viewModel.damageWaiverAgreed,
policyURL: GiftConstants.damagePolicyURL)
}
}
}
private var agreementsSection: some View {
VStack(alignment: .leading, spacing: SodaSpacing.s16) {
sectionTitle("이용 약관 동의")
VStack(alignment: .leading, spacing: SodaSpacing.s12) {
Text("선물 보내기 신청 전 꼭 확인해 주세요")
.appFont(size: 14, weight: .bold)
.foregroundColor(.grayee)
ForEach(shippingRules, id: \.self) { rule in
HStack(alignment: .top, spacing: SodaSpacing.s6) {
helper("•")
helper(rule)
}
}
}
.padding(SodaSpacing.s14)
.background(Color.gray900)
.cornerRadius(SodaRadius.r8)
GiftAgreementRow(title: "소다라이브 크리에이터 선물 보내기 이용약관에 동의합니다.",
isAgreed: $viewModel.senderTermsAgreed)
GiftAgreementRow(title: "선물 보내기를 위한 개인정보 수집·이용에 동의합니다.",
isAgreed: $viewModel.senderPrivacyAgreed)
}
}
private var shippingRules: [String] {
[
"일반 공산품 중 세 변 합 100cm 이하, 5kg 이하, 내품가 40만원 이하의 소형 선물만 접수합니다.",
"신선식품은 접수할 수 없으며, 아크릴·피규어·응원봉 등 파손 위험이 있는 상품은 별도 동의가 필요할 수 있습니다.",
"선물 보내기에 필요한 개인정보는 회원 주소록처럼 장기 저장하지 않고 전달 절차에 필요한 기간에만 일시적으로 이용합니다.",
"선물은 반드시 배송비 선불로 발송해 주세요. 착불로 발송된 선물은 수취가 거부됩니다."
]
}
private var sectionDivider: some View {
Color.gray900.frame(height: 7).padding(.horizontal, -SodaSpacing.s14)
}
private func sectionTitle(_ title: String) -> some View {
Text(title).appFont(.heading3).foregroundColor(.white)
}
private func helper(_ text: String) -> some View {
Text(text).appFont(size: 12, weight: .regular).foregroundColor(.gray500)
.fixedSize(horizontal: false, vertical: true)
}
private func sizeTitle(_ code: String) -> String {
switch GiftSize(rawValue: code) {
case .small: return "소형"
case .medium: return "중형"
case .large: return "대형"
case nil: return code
}
}
}
@@ -0,0 +1,168 @@
import Foundation
import Combine
final class GiftSendViewModel: ObservableObject {
let recipientMemberId: Int
let recipientCreatorNickname: String
private let repository = GiftRepository()
private let onCreated: (String) -> Void
private var subscription = Set<AnyCancellable>()
private var hasLoaded = false
@Published private(set) var sizes = [GiftSizeOptionResponse]()
@Published private(set) var categories = [GiftCategoryOptionResponse]()
@Published var selectedSize: GiftSizeOptionResponse?
@Published private(set) var selectedCategory: GiftCategoryOptionResponse?
@Published var senderName = ""
@Published var senderPhoneNumber = ""
@Published var senderZipCode = ""
@Published var senderAddress = ""
@Published var senderAddressDetail = ""
@Published var senderTermsAgreed = false
@Published var senderPrivacyAgreed = false
@Published var damageWaiverAgreed = false
@Published private(set) var isLoading = false
@Published private(set) var isSubmitting = false
@Published var errorMessage = ""
@Published var isShowPopup = false
var isRecipientContextValid: Bool {
recipientMemberId > 0
&& !recipientCreatorNickname.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty
}
var canSubmit: Bool {
!isSubmitting
&& isRecipientContextValid
&& selectedSize != nil
&& selectedCategory != nil
&& GiftContactInputRule.name.acceptsSubmission(senderName)
&& GiftContactInputRule.phoneNumber.acceptsSubmission(senderPhoneNumber)
&& [senderZipCode, senderAddress].allSatisfy {
!$0.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty
}
&& senderTermsAgreed
&& senderPrivacyAgreed
&& (selectedCategory?.requiresDamageWaiver != true || damageWaiverAgreed)
}
init(recipientMemberId: Int, recipientCreatorNickname: String, onCreated: @escaping (String) -> Void) {
self.recipientMemberId = recipientMemberId
self.recipientCreatorNickname = recipientCreatorNickname
self.onCreated = onCreated
}
func selectCategory(_ category: GiftCategoryOptionResponse) {
if selectedCategory?.categoryId != category.categoryId || !category.requiresDamageWaiver {
damageWaiverAgreed = false
}
selectedCategory = category
}
func submitGift() {
guard canSubmit, let request = makeRequest() else { return }
isSubmitting = true
errorMessage = ""
isShowPopup = false
repository.createGift(request: request)
.receive(on: DispatchQueue.main)
.sink { [weak self] result in
if case .failure(let error) = result {
self?.showSubmissionError(data: error.response?.data)
}
} receiveValue: { [weak self] response in
guard let self else { return }
do {
let decoded = try JSONDecoder().decode(ApiResponse<CreateGiftResponse>.self, from: response.data)
guard decoded.success, let data = decoded.data else {
self.showSubmissionError(data: response.data)
return
}
self.onCreated(data.applicationNo)
} catch {
self.showSubmissionError(data: response.data)
}
}
.store(in: &subscription)
}
private func makeRequest() -> CreateGiftRequest? {
guard let selectedSize, let selectedCategory else { return nil }
return CreateGiftRequest(
recipientMemberId: recipientMemberId,
senderName: senderName.trimmingCharacters(in: .whitespacesAndNewlines),
senderPhoneNumber: senderPhoneNumber.trimmingCharacters(in: .whitespacesAndNewlines),
senderZipCode: senderZipCode.trimmingCharacters(in: .whitespacesAndNewlines),
senderAddress: senderAddress.trimmingCharacters(in: .whitespacesAndNewlines),
senderAddressDetail: senderAddressDetail.trimmingCharacters(in: .whitespacesAndNewlines),
sizeCode: selectedSize.sizeCode.trimmingCharacters(in: .whitespacesAndNewlines),
categoryId: selectedCategory.categoryId,
senderTermsAgreed: senderTermsAgreed,
senderPrivacyAgreed: senderPrivacyAgreed,
damageWaiverAgreed: selectedCategory.requiresDamageWaiver && damageWaiverAgreed
)
}
private func showSubmissionError(data: Data?) {
struct ErrorResponse: Decodable {
let message: String?
}
let decoded = data.flatMap { try? JSONDecoder().decode(ErrorResponse.self, from: $0) }
let message = decoded?.message?.trimmingCharacters(in: .whitespacesAndNewlines) ?? ""
errorMessage = message.isEmpty ? I18n.Common.commonError : message
isSubmitting = false
isShowPopup = true
}
func fetchFormOptions() {
guard isRecipientContextValid else {
errorMessage = I18n.Common.commonError
isShowPopup = true
return
}
guard !isLoading, !hasLoaded else { return }
isLoading = true
errorMessage = ""
isShowPopup = false
repository.getFormOptions()
.receive(on: DispatchQueue.main)
.sink { [weak self] result in
guard let self else { return }
self.isLoading = false
if case .failure = result {
self.errorMessage = I18n.Common.commonError
self.isShowPopup = true
}
} receiveValue: { [weak self] response in
guard let self else { return }
do {
let decoded = try JSONDecoder().decode(ApiResponse<GiftFormOptionsResponse>.self, from: response.data)
if let data = decoded.data, decoded.success {
self.sizes = data.sizes
self.categories = data.categories
self.selectedSize = data.sizes.first
self.selectedCategory = nil
self.hasLoaded = true
} else {
self.errorMessage = decoded.message ?? I18n.Common.commonError
self.isShowPopup = true
}
} catch {
self.errorMessage = I18n.Common.commonError
self.isShowPopup = true
}
}
.store(in: &subscription)
}
}
@@ -0,0 +1,37 @@
import SwiftUI
struct GiftCourierPickerView: View {
@Binding var selectedCourier: String?
var body: some View {
VStack(alignment: .leading, spacing: SodaSpacing.s12) {
Text("택배사")
.appFont(.body5)
.foregroundColor(.white)
Menu {
ForEach(GiftConstants.courierCompanyNames, id: \.self) { courier in
Button(courier) {
selectedCourier = courier
}
}
} label: {
HStack(spacing: SodaSpacing.s12) {
Text(selectedCourier ?? "택배사 선택")
.fixedSize(horizontal: false, vertical: true)
.frame(maxWidth: .infinity, alignment: .leading)
Image(systemName: "chevron.down")
.accessibilityHidden(true)
}
.appFont(.body3)
.foregroundColor(selectedCourier == nil ? .gray500 : .white)
.padding(SodaSpacing.s14)
.frame(maxWidth: .infinity)
.background(Color.gray900)
.clipShape(RoundedRectangle(cornerRadius: SodaRadius.r14))
}
.accessibilityLabel("택배사")
.accessibilityValue(selectedCourier ?? "택배사 선택")
}
.frame(maxWidth: .infinity, alignment: .leading)
}
}
@@ -0,0 +1,293 @@
import SwiftUI
struct GiftTrackingRegistrationView: View {
@StateObject private var viewModel: GiftTrackingRegistrationViewModel
@State private var hasAppeared = false
@State private var isActive = false
@State private var isShowingCancelDialog = false
@FocusState private var isTrackingNumberFocused: Bool
init(applicationNo: String) {
_viewModel = StateObject(wrappedValue: GiftTrackingRegistrationViewModel(applicationNo: applicationNo, onUnavailable: { unavailableApplicationNo in
AppState.shared.replaceCurrentAppStep(
step: .giftDetail(applicationNo: unavailableApplicationNo),
ifCurrentStep: { step in
guard case .giftTrackingRegistration(let currentApplicationNo) = step else { return false }
return currentApplicationNo == unavailableApplicationNo
}
)
}, onMutationCompleted: { completedApplicationNo, completion in
AppState.shared.replaceCurrentAppStep(
step: .giftDetail(applicationNo: completedApplicationNo),
ifCurrentStep: { step in
guard case .giftTrackingRegistration(let currentApplicationNo) = step else { return false }
return currentApplicationNo == completedApplicationNo
},
completion: completion
)
}))
}
var body: some View {
VStack(spacing: 0) {
DetailNavigationBar(title: "운송장 등록")
.disabled(viewModel.isSubmitting)
BaseView(isLoading: .constant(viewModel.isLoading || viewModel.isSubmitting)) {
if let summary = viewModel.summary, let mailbox = viewModel.mailbox {
ScrollView {
LazyVStack(alignment: .leading, spacing: SodaSpacing.s24) {
summaryCard(summary)
VStack(alignment: .leading, spacing: SodaSpacing.s12) {
sectionHeader("보내실 주소", helper: "아래 주소로 발송한 뒤 운송장 번호를 등록해 주세요")
VStack(alignment: .leading, spacing: SodaSpacing.s14) {
GiftInfoRow(title: "사서함", value: mailbox.name)
GiftInfoRow(title: "주소", value: mailbox.address)
GiftInfoRow(title: "연락처", value: mailbox.phoneNumber)
}
.padding(SodaSpacing.s14)
.frame(maxWidth: .infinity, alignment: .leading)
.background(Color.gray900)
.clipShape(RoundedRectangle(cornerRadius: SodaRadius.r14))
}
sectionDivider
trackingSection
sectionDivider
guidanceSection
}
.padding(.horizontal, SodaSpacing.s14)
.padding(.top, SodaSpacing.s24)
.padding(.bottom, SodaSpacing.s32)
}
.scrollDismissesKeyboard(.interactively)
.safeAreaInset(edge: .bottom, spacing: 0) {
actionBar
}
} else if !viewModel.isLoading && !viewModel.errorMessage.isEmpty {
ScrollView {
VStack(spacing: SodaSpacing.s16) {
Text(viewModel.errorMessage)
.appFont(.body3)
.foregroundColor(.gray500)
.multilineTextAlignment(.center)
.fixedSize(horizontal: false, vertical: true)
if !viewModel.shouldReturnToDetail {
Button(action: viewModel.fetch) {
Text("다시 시도")
.appFont(.body2)
.foregroundColor(.white)
.padding(.horizontal, SodaSpacing.s16)
.frame(minHeight: SodaSpacing.s48)
.background(Color.gray800)
.clipShape(Capsule())
}
.buttonStyle(.plain)
}
}
.padding(SodaSpacing.s24)
.frame(maxWidth: .infinity)
}
}
}
.disabled(viewModel.isSubmitting)
}
.background(Color.black.ignoresSafeArea())
.alert("신청 취소", isPresented: $isShowingCancelDialog) {
Button("취소하기", role: .destructive) {
viewModel.confirmCancel()
}
.disabled(viewModel.isSubmitting)
Button("나가기", role: .cancel) {
isShowingCancelDialog = false
}
} message: {
Text(cancelMessage)
}
.sodaToast(isPresented: $viewModel.isShowPopup, message: viewModel.errorMessage)
.sodaToast(isPresented: $viewModel.isShowSuccessToast, message: viewModel.successMessage)
.onChange(of: viewModel.isShowPopup) { isPresented in
if !isPresented && isActive {
viewModel.errorToastDidDismiss()
}
}
.onChange(of: viewModel.isShowSuccessToast) { isPresented in
if !isPresented && isActive {
viewModel.successToastDidDismiss()
}
}
.onAppear {
isActive = true
viewModel.errorToastDidDismiss()
viewModel.successToastDidDismiss()
guard !hasAppeared else { return }
hasAppeared = true
viewModel.fetch()
}
.onDisappear {
isActive = false
}
}
private func summaryCard(_ summary: SentGiftDetailDisplayModel) -> some View {
VStack(alignment: .leading, spacing: SodaSpacing.s12) {
Text(summary.applicationNo)
.appFont(.caption3)
.foregroundColor(.gray500)
HStack(alignment: .top, spacing: SodaSpacing.s12) {
Circle()
.fill(Color.gray800)
.frame(width: 42, height: 42)
.accessibilityHidden(true)
VStack(alignment: .leading, spacing: SodaSpacing.s6) {
if let nickname = summary.recipientCreatorNickname {
Text(nickname)
.appFont(size: 14, weight: .semibold)
.foregroundColor(.white)
}
Text([summary.sizeName, summary.categoryName, summary.applicationDateText.map { "\($0) 신청" }]
.compactMap { $0 }.joined(separator: " · "))
.appFont(.caption3)
.foregroundColor(.gray500)
}
.fixedSize(horizontal: false, vertical: true)
.frame(maxWidth: .infinity, alignment: .leading)
}
}
.padding(SodaSpacing.s14)
.frame(maxWidth: .infinity, alignment: .leading)
.background(Color.gray900)
.clipShape(RoundedRectangle(cornerRadius: SodaRadius.r14))
}
private func sectionHeader(_ title: String, helper: String) -> some View {
VStack(alignment: .leading, spacing: SodaSpacing.s8) {
Text(title)
.appFont(.body1)
.foregroundColor(.white)
.accessibilityAddTraits(.isHeader)
Text(helper)
.appFont(.caption2)
.foregroundColor(.gray500)
}
.fixedSize(horizontal: false, vertical: true)
.frame(maxWidth: .infinity, alignment: .leading)
}
private var trackingSection: some View {
VStack(alignment: .leading, spacing: SodaSpacing.s12) {
sectionHeader("운송장 정보", helper: "등록 완료 후 수정이 불가능하니 신중히 적어주세요")
GiftCourierPickerView(selectedCourier: $viewModel.selectedCourier)
VStack(alignment: .leading, spacing: SodaSpacing.s12) {
Text("운송장 번호")
.appFont(.body5)
.foregroundColor(.white)
TextField("운송장 번호를 입력해 주세요", text: Binding(
get: { viewModel.trackingNumber },
set: { value in
guard GiftTrackingRegistrationViewModel.acceptsTrackingEditing(value) else { return }
viewModel.trackingNumber = value
}
))
.appFont(.body3)
.foregroundColor(.white)
.textInputAutocapitalization(.never)
.autocorrectionDisabled()
.keyboardType(.numberPad)
.focused($isTrackingNumberFocused)
.submitLabel(.done)
.onSubmit { isTrackingNumberFocused = false }
.padding(SodaSpacing.s14)
.frame(maxWidth: .infinity)
.background(Color.gray900)
.clipShape(RoundedRectangle(cornerRadius: SodaRadius.r14))
.accessibilityLabel("운송장 번호")
}
}
}
private var sectionDivider: some View {
Color.gray900
.frame(height: 7)
.padding(.horizontal, -SodaSpacing.s14)
.accessibilityHidden(true)
}
private var guidanceSection: some View {
VStack(alignment: .leading, spacing: SodaSpacing.s14) {
Text("등록 안내")
.appFont(.body1)
.foregroundColor(.white)
.accessibilityAddTraits(.isHeader)
VStack(alignment: .leading, spacing: SodaSpacing.s14) {
ForEach(registrationGuidance, id: \.self) { guidance in
HStack(alignment: .top, spacing: SodaSpacing.s6) {
Text("•").accessibilityHidden(true)
Text(guidance)
.fixedSize(horizontal: false, vertical: true)
.frame(maxWidth: .infinity, alignment: .leading)
}
.appFont(.caption2)
.foregroundColor(.gray500)
}
}
.padding(SodaSpacing.s14)
.frame(maxWidth: .infinity, alignment: .leading)
.background(Color.gray900)
.clipShape(RoundedRectangle(cornerRadius: SodaRadius.r14))
}
}
private var registrationGuidance: [String] {
[
"신청일로부터 3일 이내에 운송장 번호를 등록해 주세요.",
"3일 이내 운송장 번호를 등록하지 않은 경우, 선물 보내기가 자동으로 취소되며 사용한 캔이 모두 환불됩니다.",
"선물은 반드시 배송비 선불로 발송해 주세요. 착불로 발송된 선물은 수취가 거부됩니다.",
"진행 상태는 신청 상세에서 확인할 수 있습니다.",
"검수를 통과한 선물만 크리에이터에게 재배송됩니다."
]
}
private var actionBar: some View {
HStack(spacing: SodaSpacing.s14) {
Button {
guard viewModel.canCancel else { return }
isTrackingNumberFocused = false
isShowingCancelDialog = true
} label: {
Text("신청 취소")
.appFont(.body2)
.foregroundColor(viewModel.canCancel ? .white : .gray500)
.padding(.vertical, SodaSpacing.s16)
.frame(maxWidth: .infinity, minHeight: SodaSpacing.s48 + SodaSpacing.s4)
.overlay(Capsule().stroke(Color.white.opacity(0.3), lineWidth: 1))
}
.disabled(!viewModel.canCancel)
Button {
isTrackingNumberFocused = false
viewModel.registerTracking()
} label: {
Text("등록 완료")
.appFont(.body2)
.foregroundColor(viewModel.canSubmit ? .white : .gray500)
.padding(.vertical, SodaSpacing.s16)
.frame(maxWidth: .infinity, minHeight: SodaSpacing.s48 + SodaSpacing.s4)
.background(viewModel.canSubmit ? Color.button : Color.gray900)
.clipShape(Capsule())
}
.disabled(!viewModel.canSubmit)
}
.buttonStyle(.plain)
.padding(SodaSpacing.s14)
.background(Color.black)
}
private var cancelMessage: String {
let firstLine: String
if let nickname = viewModel.summary?.recipientCreatorNickname?.trimmingCharacters(in: .whitespacesAndNewlines),
!nickname.isEmpty {
firstLine = "\(nickname)에게 보내는 선물을 취소할까요?"
} else {
firstLine = "보내는 선물을 취소할까요?"
}
return firstLine + "\n선물 보내기 규정에 따라 선물 취소 및 사용한 캔이 모두 환불됩니다."
}
}
@@ -0,0 +1,254 @@
import Foundation
import Combine
final class GiftTrackingRegistrationViewModel: ObservableObject {
private let applicationNo: String
private let onUnavailable: (String) -> Void
private let onMutationCompleted: (String, @escaping (Bool) -> Void) -> Void
private let repository = GiftRepository()
private var subscription: AnyCancellable?
private var mutationSubscription: AnyCancellable?
private var hasCompletedMutation = false
private var hasStartedMutationNavigation = false
@Published private(set) var summary: SentGiftDetailDisplayModel?
@Published private(set) var mailbox: GiftAddressDisplayModel?
@Published private(set) var isLoading = false
@Published private(set) var isSubmitting = false
@Published private(set) var errorMessage = ""
@Published private(set) var successMessage = "운송장이 등록되었습니다."
@Published private(set) var shouldReturnToDetail = false
@Published var isShowPopup = false
@Published var isShowSuccessToast = false
@Published var selectedCourier: String?
@Published var trackingNumber = ""
static func acceptsTrackingEditing(_ value: String) -> Bool {
value.utf8.count <= 14 && value.utf8.allSatisfy { (48...57).contains($0) }
}
static func acceptsTrackingSubmission(_ value: String) -> Bool {
value.utf8.count >= 10 && acceptsTrackingEditing(value)
}
var canRegister: Bool {
mailbox != nil && !isLoading && !shouldReturnToDetail
}
var canSubmit: Bool {
guard let selectedCourier else { return false }
return canRegister
&& !isSubmitting
&& !hasCompletedMutation
&& !selectedCourier.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty
&& Self.acceptsTrackingSubmission(trackingNumber)
}
var canCancel: Bool {
canRegister && summary?.status == .received && !isSubmitting && !hasCompletedMutation
}
init(
applicationNo: String,
onUnavailable: @escaping (String) -> Void = { _ in }
) {
self.applicationNo = applicationNo
self.onUnavailable = onUnavailable
self.onMutationCompleted = { _, completion in
completion(true)
}
}
init(
applicationNo: String,
onUnavailable: @escaping (String) -> Void,
onMutationCompleted: @escaping (String, @escaping (Bool) -> Void) -> Void
) {
self.applicationNo = applicationNo
self.onUnavailable = onUnavailable
self.onMutationCompleted = onMutationCompleted
}
func fetch() {
guard !isLoading, !isSubmitting, !shouldReturnToDetail else { return }
summary = nil
mailbox = nil
errorMessage = ""
isShowPopup = false
isLoading = true
subscription = repository.getGift(applicationNo: applicationNo)
.receive(on: DispatchQueue.main)
.sink { [weak self] result in
guard let self else { return }
if case .failure(let error) = result {
self.showError(data: error.response?.data)
}
self.isLoading = false
} receiveValue: { [weak self] response in
guard let self else { return }
do {
let decoded = try JSONDecoder().decode(ApiResponse<GiftDetailResponse>.self, from: response.data)
guard decoded.success, let detail = decoded.data else {
self.showError(data: response.data)
return
}
guard let sentDetail = GiftDisplayPolicy.sentDetail(from: detail) else {
self.showUnavailable(data: response.data)
return
}
guard sentDetail.status != .canceled else {
self.showUnavailable(data: response.data)
return
}
guard detail.trackingRequired else {
self.showUnavailable(data: response.data)
return
}
guard let mailbox = detail.mailbox else {
self.showMissingMailboxError()
return
}
self.summary = sentDetail
self.mailbox = GiftAddressDisplayModel(
name: mailbox.name,
phoneNumber: mailbox.phoneNumber,
address: mailbox.address
)
} catch {
self.showError(data: response.data)
}
}
}
func registerTracking() {
guard canSubmit, let selectedCourier else { return }
let request = RegisterGiftTrackingRequest(
courierCompanyName: selectedCourier,
trackingNumber: trackingNumber.trimmingCharacters(in: .whitespacesAndNewlines)
)
beginMutation()
mutationSubscription = repository.registerTracking(applicationNo: applicationNo, request: request)
.receive(on: DispatchQueue.main)
.sink { [weak self] result in
guard let self, !self.hasCompletedMutation else { return }
if case .failure(let error) = result {
self.finishMutationFailure(data: error.response?.data)
}
} receiveValue: { [weak self] response in
guard let self, !self.hasCompletedMutation else { return }
do {
let decoded = try JSONDecoder().decode(ApiResponseWithoutData.self, from: response.data)
guard decoded.success else {
self.finishMutationFailure(data: response.data)
return
}
self.finishRegistrationSuccess()
} catch {
self.finishMutationFailure(data: response.data)
}
}
}
func confirmCancel() {
guard canCancel else { return }
beginMutation()
mutationSubscription = repository.cancelGift(applicationNo: applicationNo)
.receive(on: DispatchQueue.main)
.sink { [weak self] result in
guard let self, !self.hasCompletedMutation else { return }
if case .failure(let error) = result {
self.finishMutationFailure(data: error.response?.data)
}
} receiveValue: { [weak self] response in
guard let self, !self.hasCompletedMutation else { return }
do {
let decoded = try JSONDecoder().decode(ApiResponseWithoutData.self, from: response.data)
guard decoded.success else {
self.finishMutationFailure(data: response.data)
return
}
self.finishCancellationSuccess()
} catch {
self.finishMutationFailure(data: response.data)
}
}
}
func successToastDidDismiss() {
guard hasCompletedMutation, !isShowSuccessToast else { return }
navigateAfterMutation()
}
func errorToastDidDismiss() {
guard !isShowPopup, shouldReturnToDetail else { return }
shouldReturnToDetail = false
onUnavailable(applicationNo)
}
private func beginMutation() {
isSubmitting = true
errorMessage = ""
isShowPopup = false
}
private func finishRegistrationSuccess() {
hasCompletedMutation = true
isShowSuccessToast = true
}
private func finishCancellationSuccess() {
hasCompletedMutation = true
navigateAfterMutation()
}
private func finishMutationFailure(data: Data?) {
isSubmitting = false
showError(data: data)
}
private func navigateAfterMutation() {
guard hasCompletedMutation, !hasStartedMutationNavigation else { return }
hasStartedMutationNavigation = true
onMutationCompleted(applicationNo) { [weak self] didReplace in
guard let self, !didReplace, self.isSubmitting else { return }
self.isSubmitting = false
self.fetch()
}
}
private func showUnavailable(data: Data?) {
showError(data: data)
shouldReturnToDetail = true
}
private func showMissingMailboxError() {
errorMessage = "받을 주소가 등록되어 있지 않습니다."
isShowPopup = true
}
private func showError(data: Data?) {
struct ErrorResponse: Decodable {
let message: String?
}
let decoded = data.flatMap { try? JSONDecoder().decode(ErrorResponse.self, from: $0) }
let message = decoded?.message?.trimmingCharacters(in: .whitespacesAndNewlines) ?? ""
errorMessage = message.isEmpty ? I18n.Common.commonError : message
isShowPopup = true
}
}

Some files were not shown because too many files have changed in this diff Show More