Skip to content

[FEAT/#730] 피드백 확인 전면 광고 구현#736

Merged
nhyeonii merged 10 commits intodevelopfrom
feat/#730-interstitial-ads
Mar 18, 2026
Merged

[FEAT/#730] 피드백 확인 전면 광고 구현#736
nhyeonii merged 10 commits intodevelopfrom
feat/#730-interstitial-ads

Conversation

@nhyeonii
Copy link
Copy Markdown
Collaborator

Related issue 🛠

Work Description ✏️

:core:ads — 전면광고 인프라 구축

  • AdsPreloadManagerpreloadInterstitial() 추가
  • HilingualInterstitialAd.kt 신규 생성 — 프리로드 캐시 hit 시 즉시 노출, miss 시 새로 로드 후 노출하는 폴백 로직 포함
  • 광고 로드/표시 실패 시에도 onAdFailed()로 피드백 화면이 반드시 노출되도록 방어 처리

data 레이어 — 서버 연동 준비

  • DiaryContentModel, DiaryContentResponseDtoisAdWatched 필드 추가
  • PATCH /api/v1/diaries/{diaryId}/ad-watch API 전 레이어 연결 완료
  • 서버 미완성 상태이므로 DiaryContentResponseDto.toModel()에서 isAdWatched = false로 임시 고정

DiaryFeedbackViewModel — 광고 상태 관리

  • 데이터 로드 완료 후 isAdWatched == false이면 ShowInterstitialAd SideEffect 발행
  • onAdWatched() — 광고 정상 시청 시 patchAdWatch API 호출 후 isAdWatched = true로 업데이트

Screenshot 📸

Screen_Recording_20260315_184542.mp4

Uncompleted Tasks 😅

  • 서버 연결

To Reviewers 📢

전면 광고 작업 완료했습니다! 광고 작업은 처음이라 더 좋은 방법 있다면 리뷰 남겨주세요! 그리고 프리로드는 피드백 Funnel의 진입점인 DiaryWriteViewModel.init에서 프리로드를 시작했습니다. 일기 작성 화면 진입 시점부터 백그라운드에서 광고를 미리 준비해두어 피드백 화면 진입 시 딜레이를 최소화하도록 해보았습니다!

@nhyeonii nhyeonii self-assigned this Mar 15, 2026
@nhyeonii nhyeonii requested a review from a team as a code owner March 15, 2026 12:04
@nhyeonii nhyeonii removed the request for review from a team March 15, 2026 12:04
@nhyeonii nhyeonii added the FEAT✨ 사용자에게 제공되는 새로운 기능 구현 및 동작 변경 label Mar 15, 2026
@nhyeonii nhyeonii added the 🍀큰나현 큰나현 담당 label Mar 15, 2026
Copy link
Copy Markdown
Member

@angryPodo angryPodo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생했어요! 레퍼런스 없는 SDK 사용하느라 정말로 고생했습니다ㅎㅎ 고민거리 남겨놧으니 반영하고 리뷰 요청 다시 주세요!

Copy link
Copy Markdown
Member

@nahy-512 nahy-512 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

작업 고생하셨습니다:)
isAdWatched 판단 기준이 궁금한데, 이 부분만 한번 확인해주시면 좋을 것 같습니다!

Comment on lines +112 to +114
} else {
viewModel.onAdWatched()
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onAdWatched는 서버로 내가 Ad를 봤다고 보내는 로직으로 이해했는데요, 광고 시청을 완료했는지와 상관없이 호출해주는 걸까요??

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 광고 정상 시청과 실패 모두 동일하게 onAdDismissed를 호출하고 fetchAdWatched()로 넘어가도록 의도적으로 설계했습니다 ! fetchAdWatched() 내부에서 낙관적 업데이트 후 patchAdWatch() API를 호출하고 실패 시 onLogFailure에서 처리하는 구조로 모든 케이스를 일관되게 흘리는 방식입니다. 광고 실패가 사용자 책임이 아니기 때문에 실패했다고 피드백 화면 진입을 막는 건 잘못된 UX라고 판단했고 서버 동기화는 재시도 로직으로 보완할 예정입니다 !!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고민이 되는 부분이었을텐데 광고 실패를 사용자의 책임으로 판단하지 않고 화면 진입을 할 수 있도록 처리한 설계가 좋은 것 같아요 🤩

@nhyeonii nhyeonii requested a review from angryPodo March 17, 2026 12:44
Copy link
Copy Markdown
Collaborator

@Daljyeong Daljyeong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

리뷰가 늦어서 미안합니다 🥲🙇🏻‍♀️
덕분에 광고 설계 구조를 더 익혀갈 수 있는 것 같아요! 작업 넘넘 고생하셨습니다 🚀

private val diaryRepository: DiaryRepository,
private val diaryLocalRepository: DiaryLocalRepository,
private val textRecognitionRepository: TextRecognitionRepository,
adsPreloadManager: AdsPreloadManager,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기엔 따로 private val이 안 붙은 이유가 궁금합니다 :)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adsPreloadManagerinit 블록에서 preloadInterstitial 호출 후 더 이상 사용되지 않아서 private val로 프로퍼티화하지 않았습니다. 불필요한 참조를 ViewModel이 들고 있지 않도록 의도적으로 생략했습니다 !

Comment on lines +112 to +114
} else {
viewModel.onAdWatched()
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고민이 되는 부분이었을텐데 광고 실패를 사용자의 책임으로 판단하지 않고 화면 진입을 할 수 있도록 처리한 설계가 좋은 것 같아요 🤩

Comment on lines +102 to +104
/*TODO: 서버 동기화 실패 처리
patchAdWatch API 실패 시 서버는 여전히 isAdWatched = false 상태입니다.
WorkManager로 Sync 필요*/
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요거 너무 좋은데 포맷팅만 조금 고칩시다! 공백이라던가ㅎㅎ

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

좋아요 !! c7dfc6a 커밋에 반영했습니다 !

Copy link
Copy Markdown
Member

@angryPodo angryPodo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

너무 좋은데요! 머지합시다~~~ 완전 수고했어요! 이번 작업하면서 알게된거 아티클로 남기면 레퍼런스가 없어서 조회수 많이 나올수도..ㅋㅋ

Copy link
Copy Markdown
Collaborator

@Hyobeen-Park Hyobeen-Park left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저도 admob은 처음이라 신기하네요ㅎㅎ 수고하셨습니다~!

showInterstitialAd(
activity = activity,
adUnitId = BuildConfig.ADMOB_INTERSTITIAL_UNIT_ID,
onAdDismissed = { viewModel.fetchAdWatched() },
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onAdDismissed = viewModel::fetchAdWatched
로 안하구 람다 생성해서 넘기신 이유가 무엇인가요?? 다른 의도나 추후 확장성을 고려하신건지 궁금합니다 🙂

Copy link
Copy Markdown
Collaborator Author

@nhyeonii nhyeonii Mar 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

특별한 의도는 없었습니다! a437a07 말씀해주신 대로 viewModel::fetchAdWatched로 변경하겠습니다 !

…tial-ads

# Conflicts:
#	core/ads/src/main/java/com/hilingual/core/ads/manager/AdsPreloadManager.kt
#	core/ads/src/main/java/com/hilingual/core/ads/manager/AdsPreloadManagerImpl.kt
#	presentation/diaryfeedback/src/main/java/com/hilingual/presentation/diaryfeedback/DiaryFeedbackScreen.kt
@nhyeonii nhyeonii merged commit 390ce5c into develop Mar 18, 2026
2 checks passed
@nhyeonii nhyeonii deleted the feat/#730-interstitial-ads branch March 18, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FEAT✨ 사용자에게 제공되는 새로운 기능 구현 및 동작 변경 🍀큰나현 큰나현 담당

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] 피드백 확인 전면 광고를 구현해요

5 participants