From b9ca9e8865da7b864fa6f426d64008c423daf235 Mon Sep 17 00:00:00 2001 From: sanghyeok-kim Date: Fri, 11 Aug 2023 14:55:44 +0900 Subject: [PATCH 1/2] =?UTF-8?q?#55=20feat:=20SKStoreReviewController+reque?= =?UTF-8?q?stReviewInCurrentScene=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Multimer/Multimer.xcodeproj/project.pbxproj | 4 ++++ ...ntroller+requestReviewInCurrentScene.swift | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 Multimer/Multimer/Presentation/Support/Extension/SKStoreReviewController+requestReviewInCurrentScene.swift diff --git a/Multimer/Multimer.xcodeproj/project.pbxproj b/Multimer/Multimer.xcodeproj/project.pbxproj index da2d5cd..9019562 100644 --- a/Multimer/Multimer.xcodeproj/project.pbxproj +++ b/Multimer/Multimer.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 1E1869B32A8603D8000AFDC6 /* SKStoreReviewController+requestReviewInCurrentScene.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E1869B22A8603D8000AFDC6 /* SKStoreReviewController+requestReviewInCurrentScene.swift */; }; 1E1C42E22A765844003CC427 /* RingtoneSelectViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E1C42E12A765844003CC427 /* RingtoneSelectViewController.swift */; }; 1E1C43662A7681FA003CC427 /* radar.aiff in Resources */ = {isa = PBXBuildFile; fileRef = 1E1C43522A7681F8003CC427 /* radar.aiff */; }; 1E1C43672A7681FA003CC427 /* alarm.aiff in Resources */ = {isa = PBXBuildFile; fileRef = 1E1C43532A7681F9003CC427 /* alarm.aiff */; }; @@ -155,6 +156,7 @@ /* Begin PBXFileReference section */ 02A9A991A8E30450D4458665 /* Pods_MultimerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MultimerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 09D9588E5DAECA7EB7A30024 /* Pods_Multimer_MultimerUITests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Multimer_MultimerUITests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 1E1869B22A8603D8000AFDC6 /* SKStoreReviewController+requestReviewInCurrentScene.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SKStoreReviewController+requestReviewInCurrentScene.swift"; sourceTree = ""; }; 1E1C42DF2A760939003CC427 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/InfoPlist.strings; sourceTree = ""; }; 1E1C42E02A760939003CC427 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Localizable.strings; sourceTree = ""; }; 1E1C42E12A765844003CC427 /* RingtoneSelectViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RingtoneSelectViewController.swift; sourceTree = ""; }; @@ -673,6 +675,7 @@ 1E23D56A299A1110008FD287 /* UIView+shouldFadeIn.swift */, 1E744B97296C488A00CD824D /* UIStackView+addArrangedSubviews.swift */, 1E23D5362994BCF8008FD287 /* NotificationName+CustomName.swift */, + 1E1869B22A8603D8000AFDC6 /* SKStoreReviewController+requestReviewInCurrentScene.swift */, ); path = Extension; sourceTree = ""; @@ -1148,6 +1151,7 @@ 1E744BB2296C488A00CD824D /* TimerFilteringCondition.swift in Sources */, 1E4CB4DF2966BE9000FC918E /* TimeMO+CoreDataClass.swift in Sources */, 1E744BB4296C488A00CD824D /* TimeType.swift in Sources */, + 1E1869B32A8603D8000AFDC6 /* SKStoreReviewController+requestReviewInCurrentScene.swift in Sources */, 1E744BB8296C488A00CD824D /* SymbolImageButton.swift in Sources */, 1E8C28F42A73C0C100935C5E /* CoordinatorType.swift in Sources */, 1E23D56B299A1110008FD287 /* UIView+shouldFadeIn.swift in Sources */, diff --git a/Multimer/Multimer/Presentation/Support/Extension/SKStoreReviewController+requestReviewInCurrentScene.swift b/Multimer/Multimer/Presentation/Support/Extension/SKStoreReviewController+requestReviewInCurrentScene.swift new file mode 100644 index 0000000..5b74e15 --- /dev/null +++ b/Multimer/Multimer/Presentation/Support/Extension/SKStoreReviewController+requestReviewInCurrentScene.swift @@ -0,0 +1,19 @@ +// +// SKStoreReviewController+requestReviewInCurrentScene.swift +// Multimer +// +// Created by κΉ€μƒν˜ on 2023/08/11. +// + +import Foundation +import StoreKit + +extension SKStoreReviewController { + static func requestReviewInCurrentScene() { + if let scene = UIApplication.shared.connectedScenes.first(where: { + $0.activationState == .foregroundActive + }) as? UIWindowScene { + requestReview(in: scene) + } + } +} From 4198b87b21af66231a913e5ca905d8d5121d995e Mon Sep 17 00:00:00 2001 From: sanghyeok-kim Date: Fri, 11 Aug 2023 14:56:24 +0900 Subject: [PATCH 2/2] =?UTF-8?q?#55=20feat:=20SceneDelegate=EC=97=90?= =?UTF-8?q?=EC=84=9C=20requestReviewInCurrentScene=20=EC=8B=A4=ED=96=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Multimer/Multimer/Application/SceneDelegate.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Multimer/Multimer/Application/SceneDelegate.swift b/Multimer/Multimer/Application/SceneDelegate.swift index f5f2432..bb0d814 100644 --- a/Multimer/Multimer/Application/SceneDelegate.swift +++ b/Multimer/Multimer/Application/SceneDelegate.swift @@ -6,6 +6,7 @@ // import UIKit +import StoreKit class SceneDelegate: UIResponder, UIWindowSceneDelegate { @@ -24,6 +25,8 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { window?.rootViewController = rootNavigationController window?.makeKeyAndVisible() + + SKStoreReviewController.requestReviewInCurrentScene() } }