Skip to content

Conversation

@cirtuare
Copy link
Contributor

@cirtuare cirtuare commented Jun 7, 2025

🐿️ Pull Requests

🪵 작업 브랜치

🥔 작업 내용

구글 애즈를 적용했습니다

🚨 참고 사항

Shared.xcconfig 변경되었습니다! 슬랙에 첨부해둘게요

광고 타입(GoogleAdsType)은 Spotlist에 적용되는 .imageOnly (이미지만) 와 Profile에 적용되는 .both (이미지, 영상 모두)이 있습니다.
각각 동시 로딩 및 관리가 가능하도록 GoogleAdsManager에서 관련 프로퍼티들을 GoogleAdsType을 key로 가지는 딕셔너리로 제작했습니다.

광고가 로드되지 않은 경우 스켈레톤 뷰를 띄웁니다. (추후 완성되면 적용 예정)

광고는 타입별로 하나씩만 미리 캐싱해두고 있습니다.
이 때문에 한 번 광고를 본 직후 다음 광고를 보려 하면 (시뮬 영상 후반의 홈-프로필 빠르게 왔다갔다) 로드가 안 된 경우가 나오는데, 정말 빠르게 이동해야 나오는 케이스라 드물 것이라 판단하였고, 광고가 로드되지 않는 게 사용성에 큰 저하를 끼치지 않는다고 생각해서 다음과 같이 구현했습니다. 여러 개 캐싱 시 해당 문제가 덜 발생하겠지만, 광고를 여러 개 캐싱 시 메모리 문제가 있을 수 있으며, 캐싱 후 사용 안 할 광고에 메모리 낭비를 하고 싶지 않았습니다! 또한 한 번에 하나만 보여주는 앱 특성상 굳이 여러 개 캐싱할 필요는 없다고 판단했습니다.

📸 스크린샷

기능 스크린샷
아이폰 16 Pro

💥 To be sure

  • 모든 뷰가 잘 실행되는지 다시 한 번 체크해주세요 !

🌰 Resolve issue

@cirtuare cirtuare added this to the Sprint - 3 milestone Jun 7, 2025
@cirtuare cirtuare requested a review from yurim830 June 7, 2025 06:20
@cirtuare cirtuare self-assigned this Jun 7, 2025
@cirtuare cirtuare added 🌀 feature 새로운 기능 개발 🍓 수민 수민 labels Jun 7, 2025
Copy link
Collaborator

@yurim830 yurim830 left a comment

Choose a reason for hiding this comment

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

최고다ㅜㅜ 고생하셨습니다!! 감사해요 ✨

return adLoaders.first { $1 === adLoader }?.key
}

func cleanup(_ adType: GoogleAdsType) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

🐿️ cleanup -> cleanUp 대문자 수정 가능할까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

통칭상 한 phrase로 많이 쓰는 것 같아서 애매하다고 느꼈어요!!
그냥 cleanAdType으로 변경해두겠습니다~~

Comment on lines +60 to +70
func preloadNativeAd(_ adType: GoogleAdsType) {
guard cachedAd[adType] == nil && !loadingAds.contains(adType) else { return }

self.loadNativeAd(adType) { [weak self] ad, error in
if let ad = ad {
self?.cachedAd[adType] = ad
} else {
self?.handleAdLoadError(error)
}
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

🐿️🐿️ GoogleAdsManager 내부에서만 쓰이는 메소드같은데 맞나요? private 키 붙여줘도 좋을 것 같습니다!

@cirtuare cirtuare merged commit ac267c2 into develop Jun 7, 2025
@cirtuare
Copy link
Contributor Author

cirtuare commented Jun 7, 2025

@yurim830 바보같이 리뷰 적용한 거 푸시를 안 하고 머지했네용.. 다음 브랜치 #172에서 반영해두겠습니다 ㅠㅠ

@cirtuare cirtuare deleted the feature/#162 branch August 12, 2025 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🌀 feature 새로운 기능 개발 🍓 수민 수민

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] 구글 애즈 적용

3 participants