Skip to content

Feat/#311 앱스토어의 앱 버전과 기존 앱의 버전을 추적하여 강제 업데이트 기능#313

Merged
isakatty merged 33 commits intodevfrom
feat/#311
Mar 27, 2025
Merged

Feat/#311 앱스토어의 앱 버전과 기존 앱의 버전을 추적하여 강제 업데이트 기능#313
isakatty merged 33 commits intodevfrom
feat/#311

Conversation

@isakatty
Copy link
Contributor

@isakatty isakatty commented May 26, 2024

작업내용

기존 앱 버전과 앱스토어에 올라간 앱의 major 버전을 비교하여 앱스토어를 열어주는 alert 띄우기

⚠️ 앱스토어 연결을 위해 시뮬이 아니라 실기기 빌드 해주세요!

프로젝트 info plist 수정 실기기 연결 실행화면
스크린샷 2024-05-26 오후 3 00 44 스크린샷 2024-05-26 오후 3 01 24 아래 동영상 첨부
720p.mov

리뷰요청

관련 이슈

close #311

@isakatty isakatty added the ✨ 기능추가 새로운 기능 추가 label May 26, 2024
@isakatty isakatty requested a review from yuhaeun-la May 26, 2024 06:47
@isakatty isakatty self-assigned this May 26, 2024
@isakatty isakatty linked an issue May 26, 2024 that may be closed by this pull request
2 tasks
@yuhaeun-la
Copy link
Contributor

지수님 제가 오늘부터 목요일까지 맥북을 사용할 수 있는 환경이 아니어서, 괜찮으시면 리뷰어 분을 한명 더 등록하시는건 어떨까요? 저는 목요일 이후에 리뷰가 가능할거같아요

@isakatty
Copy link
Contributor Author

지수님 제가 오늘부터 목요일까지 맥북을 사용할 수 있는 환경이 아니어서, 괜찮으시면 리뷰어 분을 한명 더 등록하시는건 어떨까요? 저는 목요일 이후에 리뷰가 가능할거같아요

앗 ! 하은님 괜찮으시면 그렇게 하겠습니다 !

@isakatty isakatty requested a review from gnksbm May 26, 2024 06:54
= "itms-apps://itunes.apple.com/app/apple-store/"

/// 앱스토어에 등록된 최신 버전 가져오는 함수
static public func latestVersion(completion: @escaping (String?) -> Void) {
Copy link
Contributor

Choose a reason for hiding this comment

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

async await 말고 컴플리션 핸들러를 쓰신 이유가 있을까요 ?.?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

아아 app delegate 에서 쓰일 코드가 아닌데 async-await 해놨던걸 거기서 쓰다가 문제가 생겨서 completion으로 변경하고 scene delegate를 하다가 다시 수정한다는걸 잊어버렸어요 🫠
async - await으로 수정하겠습니다 !

let splitMarketingVersion = marketingVersion.split(separator: ".").map { $0 }
let splitCurrentProjectVersion = currentProjectVersion.split(separator: ".").map { $0 }

if splitCurrentProjectVersion.count > 0 && splitMarketingVersion.count > 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

이 구문이 필수적으로 필요한지 궁금합니다!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

82, 83은 [1.2.3] 이렇게 오는걸 .을 기준으로 나누기 위해서 필요하고,
85번째 줄은 .을 기준으로 잘 들어왔는지 확인하기 위해서 count로 조건을 준거였어요 !

@yuhaeun-la
Copy link
Contributor

지수님 제가 오늘부터 목요일까지 맥북을 사용할 수 있는 환경이 아니어서, 괜찮으시면 리뷰어 분을 한명 더 등록하시는건 어떨까요? 저는 목요일 이후에 리뷰가 가능할거같아요

앗 ! 하은님 괜찮으시면 그렇게 하겠습니다 !

네 그게 좋을 것 같습니다 ! 현재 깃헙만 둘러볼 수 있는 상황이어서 ㅠㅠ 코드 리뷰만 남기는 걸로 하겠습니다

Copy link
Contributor

@gnksbm gnksbm left a comment

Choose a reason for hiding this comment

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

추가로 ignore 파일 업데이트가 안되어 있어 디버깅을 못하고있어요
올려주시면 땡겨서 추가 확인해보겠습니다~

Comment on lines 15 to 16
/// 프로젝트 버전
let appVersion = String.getCurrentVersion()
Copy link
Contributor

Choose a reason for hiding this comment

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

사용되지 않는 변수인데 남겨두신 이유가 있으신가요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sceneDelegate에서 가져다 쓰려고 뒀는데 scene에서도 또 변수 만들어서 썼네요 🥲 수정하겠습니다 ~

Comment on lines 19 to 30
static let appleID = Bundle.main.object(forInfoDictionaryKey: "APPLE_ID") as? String

/// 앱스토어 연결 링크
static let appStoreURLString
= "itms-apps://itunes.apple.com/app/apple-store/"

/// 앱스토어에 등록된 최신 버전 가져오는 함수

static public func latestVersion() async -> String? {
guard let appleID = AppStoreCheck.appleID,
let url
= URL(string: "https://itunes.apple.com/lookup?id=\(appleID)&country=kr")
Copy link
Contributor

Choose a reason for hiding this comment

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

린트 오류 수정바랍니다!

"LOCATION_PRIVACY_URL": "$(LOCATION_PRIVACY_URL)",
"INQURY_URL": "$(INQURY_URL)"
"INQURY_URL": "$(INQURY_URL)",
"APPLE_ID": "$(APPLE_ID)",
Copy link
Contributor

Choose a reason for hiding this comment

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

APPLE_ID가 유저의 apple 계정 id로 유추되어서 APPSTORE_ID와 같이 표현하면 어떨까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

변경하겠습니다 !


/// 앱스토어에 등록된 최신 버전 가져오는 함수

static public func latestVersion() async -> String? {
Copy link
Contributor

Choose a reason for hiding this comment

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

함수 시그니처를 () -> Observable으로 변경하는 게 어떨까요?

@isakatty isakatty requested a review from MUKER-WON March 25, 2025 11:41
private func needsToUpdate(_ version: AppVersionInfoResponse?) -> Bool {
guard let version else { return false }
print(version.major, getUserVersion().major)
return version.major > getUserVersion().major ? true : false
Copy link
Contributor

Choose a reason for hiding this comment

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

앱의 major버전만 비교해서 업데이트 유무를 판단하게 되는거면
강제 업데이트 기준으로 major버전을 올리게 되는 형태가 될거 같은데
의도하신 부분일까요??

따라서 이번 업데이트는 1.x.x 버전에서 2.x.x 버전으로 올려야 할거 같은데
강제 업데이트는 용이하지만 버전 번호가 빠르게 증가할 확률도 높아질 수도 있겠네요.
아니면 최소 요구버전 을 명시적으로 넣는 방법도 있을 수 있겠네요
의견이 궁금해요!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

앱 강제 업데이트 기능에 대해 이야기가 나오던 시점에는 "major의 변화는 무조건 업데이트하게 유도하자." 이었습니다!
그래서 major를 기준으로 비교하는게 의도한 부분이 맞습니다. 그렇지만 말씀해주신대로 버전 번호가 빠르게 증가하게 된다는 점도 있고, 앱 버전 관리 규칙과 어긋나는 부분도 생기게 되네요!
major만을 기준으로 비교할 게 아니라 마이너와 함께 비교해서 유저의 버전과 일정 이상 떨어지게 된다면 업데이트를 유도하는 형태도 괜찮을 것 같습니다.

그리고 어제 건섭님과 이야기하며 나왔던 방식중에는, 서버와 이야기를 해서 서버에 최소 요구 버전을 두고 그 기준으로 사용자의 앱 버전을 비교해서 업데이트하는 방식도 있었습니다! 서버 측에서 작업해줄 수 있으면 이 방식이 더 좋아보이는데 이야기 해보겠습니다!
혹시 어렵게 된다면 major, minor 를 비교했을 때 2,3 버전 차이나면 업데이트 하는 방식은 어떨까요?

@isakatty isakatty merged commit 863461e into dev Mar 27, 2025
1 check passed
@isakatty isakatty deleted the feat/#311 branch March 27, 2025 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ 기능추가 새로운 기능 추가

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] 앱 버전 추적하여 강제 업데이트

4 participants