From 44163ae840cf371eae5fc85431a5ba59c81d915b Mon Sep 17 00:00:00 2001 From: Takeshi Fujiki Date: Wed, 3 Jul 2024 09:13:33 +0900 Subject: [PATCH 1/7] Support strict concurrency checking --- SwiftRater.xcodeproj/project.pbxproj | 8 +- SwiftRater/SwiftRater.swift | 223 +++++++++++++++++++++++---- SwiftRater/UsageDataManager.swift | 11 +- 3 files changed, 207 insertions(+), 35 deletions(-) diff --git a/SwiftRater.xcodeproj/project.pbxproj b/SwiftRater.xcodeproj/project.pbxproj index 5f2bdeb..23fa75e 100644 --- a/SwiftRater.xcodeproj/project.pbxproj +++ b/SwiftRater.xcodeproj/project.pbxproj @@ -481,7 +481,8 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; + SWIFT_STRICT_CONCURRENCY = complete; + SWIFT_VERSION = 6.0; }; name = Debug; }; @@ -503,7 +504,8 @@ PRODUCT_BUNDLE_IDENTIFIER = com.takecian.SwiftRater; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 5.0; + SWIFT_STRICT_CONCURRENCY = complete; + SWIFT_VERSION = 6.0; }; name = Release; }; @@ -517,6 +519,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.takecian.SwiftRaterTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_STRICT_CONCURRENCY = complete; SWIFT_VERSION = 5.0; }; name = Debug; @@ -531,6 +534,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.takecian.SwiftRaterTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_STRICT_CONCURRENCY = complete; SWIFT_VERSION = 5.0; }; name = Release; diff --git a/SwiftRater/SwiftRater.swift b/SwiftRater/SwiftRater.swift index 92fcd29..0d3f823 100644 --- a/SwiftRater/SwiftRater.swift +++ b/SwiftRater/SwiftRater.swift @@ -10,8 +10,12 @@ import StoreKit case any } -@objc public class SwiftRater: NSObject { - +@MainActor +@objc public class SwiftRater: NSObject, @unchecked Sendable { + + private static let staticLock = NSLock() + private let lock = NSLock() + enum ButtonIndex: Int { case cancel = 0 case rate = 1 @@ -22,73 +26,216 @@ import StoreKit @objc public static var daysUntilPrompt: Int { get { - UsageDataManager.shared.daysUntilPrompt + staticLock.lock() + defer { + staticLock.unlock() + } + return UsageDataManager.shared.daysUntilPrompt } set { + staticLock.lock() + defer { + staticLock.unlock() + } UsageDataManager.shared.daysUntilPrompt = newValue } } @objc public static var usesUntilPrompt: Int { get { - UsageDataManager.shared.usesUntilPrompt + staticLock.lock() + defer { + staticLock.unlock() + } + return UsageDataManager.shared.usesUntilPrompt } set { + staticLock.lock() + defer { + staticLock.unlock() + } UsageDataManager.shared.usesUntilPrompt = newValue } } @objc public static var significantUsesUntilPrompt: Int { - get { - UsageDataManager.shared.significantUsesUntilPrompt + get { + staticLock.lock() + defer { + staticLock.unlock() + } + return UsageDataManager.shared.significantUsesUntilPrompt } set { + staticLock.lock() + defer { + staticLock.unlock() + } UsageDataManager.shared.significantUsesUntilPrompt = newValue } } @objc public static var daysBeforeReminding: Int { get { - UsageDataManager.shared.daysBeforeReminding + staticLock.lock() + defer { + staticLock.unlock() + } + return UsageDataManager.shared.daysBeforeReminding } set { + staticLock.lock() + defer { + staticLock.unlock() + } UsageDataManager.shared.daysBeforeReminding = newValue } } @objc public static var debugMode: Bool { get { - UsageDataManager.shared.debugMode + staticLock.lock() + defer { + staticLock.unlock() + } + return UsageDataManager.shared.debugMode } set { + staticLock.lock() + defer { + staticLock.unlock() + } UsageDataManager.shared.debugMode = newValue } } @objc public static var conditionsMetMode: SwiftRaterConditionsMetMode { get { - UsageDataManager.shared.conditionsMetMode + staticLock.lock() + defer { + staticLock.unlock() + } + return UsageDataManager.shared.conditionsMetMode } set { + staticLock.lock() + defer { + staticLock.unlock() + } UsageDataManager.shared.conditionsMetMode = newValue } } - @objc public static var useStoreKitIfAvailable: Bool = true - - @objc public static var showLaterButton: Bool = true - - @objc public static var countryCode: String? - - @objc public static var alertTitle: String? - @objc public static var alertMessage: String? - @objc public static var alertCancelTitle: String? - @objc public static var alertRateTitle: String? - @objc public static var alertRateLaterTitle: String? - @objc public static var appName: String? - - @objc public static var showLog: Bool = false - @objc public static var resetWhenAppUpdated: Bool = true - - @objc public static var shared = SwiftRater() + nonisolated(unsafe) private static var _useStoreKitIfAvailable = true + @objc public static var useStoreKitIfAvailable: Bool { + get { + _useStoreKitIfAvailable + } + set { + _useStoreKitIfAvailable = newValue + } + } + + nonisolated(unsafe) private static var _showLaterButton = true + @objc public static var showLaterButton: Bool { + get { + _showLaterButton + } + set { + _showLaterButton = newValue + } + } + + nonisolated(unsafe) private static var _countryCode: String? + @objc public static var countryCode: String? { + get { + _countryCode + } + set { + _countryCode = newValue + } + } + + nonisolated(unsafe) private static var _alertTitle: String? + @objc public static var alertTitle: String? { + get { + _alertTitle + } + set { + _alertTitle = newValue + } + } + + nonisolated(unsafe) private static var _alertMessage: String? + @objc public static var alertMessage: String? { + get { + _alertMessage + } + set { + _alertMessage = newValue + } + } + + nonisolated(unsafe) private static var _alertCancelTitle: String? + @objc public static var alertCancelTitle: String? { + get { + _alertCancelTitle + } + set { + _alertCancelTitle = newValue + } + } + + nonisolated(unsafe) private static var _alertRateTitle: String? + @objc public static var alertRateTitle: String? { + get { + _alertRateTitle + } + set { + _alertRateTitle = newValue + } + } + + nonisolated(unsafe) private static var _alertRateLaterTitle: String? + @objc public static var alertRateLaterTitle: String? { + get { + _alertRateLaterTitle + } + set { + _alertRateLaterTitle = newValue + } + } + + nonisolated(unsafe) private static var _appName: String? + @objc public static var appName: String? { + get { + _appName + } + set { + _countryCode = newValue + } + } + + nonisolated(unsafe) private static var _showLog: Bool = false + @objc public static var showLog: Bool { + get { + _showLog + } + set { + _showLog = newValue + } + } + + nonisolated(unsafe) private static var _resetWhenAppUpdated: Bool = false + @objc public static var resetWhenAppUpdated: Bool { + get { + _resetWhenAppUpdated + } + set { + _resetWhenAppUpdated = newValue + } + } + + @objc public static let shared = SwiftRater() @objc public static var isRateDone: Bool { + UsageDataManager.shared.isRateDone } @@ -96,8 +243,24 @@ import StoreKit UsageDataManager.shared.ratingConditionsHaveBeenMet } - @objc public static var appID: String? - + nonisolated(unsafe) private static var _appID: String? + @objc public static var appID: String? { + get { + staticLock.lock() + defer { + staticLock.unlock() + } + return _appID + } + set { + staticLock.lock() + defer { + staticLock.unlock() + } + _appID = newValue + } + } + private static var appVersion: String { get { Bundle.main.infoDictionary!["CFBundleShortVersionString"] as? String ?? "0.0.0" @@ -209,7 +372,9 @@ import StoreKit let url = try iTunesURLFromString() let request = URLRequest(url: url, cachePolicy: .reloadIgnoringCacheData, timeoutInterval: 30) URLSession.shared.dataTask(with: request, completionHandler: { (data, response, error) in - self.processResults(withData: data, response: response, error: error) + Task { @MainActor in + self.processResults(withData: data, response: response, error: error) + } }).resume() } catch let error { postError(.malformedURL, underlyingError: error) diff --git a/SwiftRater/UsageDataManager.swift b/SwiftRater/UsageDataManager.swift index b3c02e9..55ea607 100644 --- a/SwiftRater/UsageDataManager.swift +++ b/SwiftRater/UsageDataManager.swift @@ -6,7 +6,7 @@ import AppKit let SwiftRaterInvalid = -1 -class UsageDataManager { +class UsageDataManager: @unchecked Sendable { var daysUntilPrompt: Int = SwiftRaterInvalid var usesUntilPrompt: Int = SwiftRaterInvalid @@ -24,7 +24,7 @@ class UsageDataManager { static private let keySwiftRaterTrackingVersion = "keySwiftRaterTrackingVersion" static private let keySwiftRaterReminderRequestDate = "keySwiftRaterReminderRequestDate" - static var shared = UsageDataManager() + static let shared = UsageDataManager() let userDefaults = UserDefaults.standard @@ -186,8 +186,11 @@ class UsageDataManager { } private func printMessage(message: String) { - if SwiftRater.showLog { - print("[SwiftRater] \(message)") + Task { + let showLog = await SwiftRater.showLog + if showLog { + print("[SwiftRater] \(message)") + } } } } From 68f022a93dc7d755aa3653c2da47c589c2cd0b72 Mon Sep 17 00:00:00 2001 From: Takeshi Fujiki Date: Thu, 4 Jul 2024 17:15:10 +0900 Subject: [PATCH 2/7] Update demo app --- Demo/Demo.xcodeproj/project.pbxproj | 4 ++++ Demo/Demo/ViewController.swift | 4 +++- Demo/Podfile | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Demo/Demo.xcodeproj/project.pbxproj b/Demo/Demo.xcodeproj/project.pbxproj index f3ac11b..aba2ead 100644 --- a/Demo/Demo.xcodeproj/project.pbxproj +++ b/Demo/Demo.xcodeproj/project.pbxproj @@ -518,6 +518,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEVELOPMENT_TEAM = 495G5CPHRQ; INFOPLIST_FILE = Demo/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.cocomoe.carp; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -537,6 +538,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEVELOPMENT_TEAM = 495G5CPHRQ; INFOPLIST_FILE = Demo/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.cocomoe.carp; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -553,6 +555,7 @@ BUNDLE_LOADER = "$(TEST_HOST)"; DEVELOPMENT_TEAM = XEV6645KTD; INFOPLIST_FILE = DemoTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.takecian.DemoTests; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -569,6 +572,7 @@ BUNDLE_LOADER = "$(TEST_HOST)"; DEVELOPMENT_TEAM = XEV6645KTD; INFOPLIST_FILE = DemoTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.takecian.DemoTests; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/Demo/Demo/ViewController.swift b/Demo/Demo/ViewController.swift index 85d17f9..ddb2141 100644 --- a/Demo/Demo/ViewController.swift +++ b/Demo/Demo/ViewController.swift @@ -14,9 +14,11 @@ class ViewController: UIViewController { override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) SwiftRater.incrementSignificantUsageCount() + // If you want to meet the condition for testing purpose, use this. + // SwiftRater.debugMode = true SwiftRater.check(host: self) - // If want to navigate app review page, use `rateApp()`. + // If your want to show rating dialog manually, use `rateApp()`. // SwiftRater.rateApp(host: self) } diff --git a/Demo/Podfile b/Demo/Podfile index 819acf4..1579f78 100644 --- a/Demo/Podfile +++ b/Demo/Podfile @@ -1,6 +1,6 @@ -platform :ios, '11.0' +platform :ios, '15.0' use_frameworks! target 'Demo' do pod 'SwiftRater', :path => '../' -end \ No newline at end of file +end From 7dbdf33e763f064cf556b986b465a21f4759bc87 Mon Sep 17 00:00:00 2001 From: Takeshi Fujiki Date: Sun, 3 Nov 2024 23:36:23 +0900 Subject: [PATCH 3/7] Update versions --- Package.swift | 2 +- README.md | 18 ++++-------------- SwiftRater.podspec | 6 +++--- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/Package.swift b/Package.swift index 9191efc..20722ef 100644 --- a/Package.swift +++ b/Package.swift @@ -5,7 +5,7 @@ let package = Package( name: "SwiftRater", defaultLocalization: "en", platforms: [ - .iOS(.v10), + .iOS(.v13), .macOS(.v10_10) ], products: [ diff --git a/README.md b/README.md index 111637a..aa15341 100644 --- a/README.md +++ b/README.md @@ -11,26 +11,16 @@ SwiftRater is a class that you can drop into any iPhone app that will help remin SwiftRater is written in pure Swift. -## iOS 10.3 〜 +## iOS ![SwiftRater1](./Resource/later1.gif) -For iOS 10.3 devices, SwiftRater uses SKStoreReviewController. - -## 〜 iOS 10.2 -![SwiftRater2](./Resource/later2.gif) - -## macOS 10.14 〜 +## macOS ![SwiftRater1](./Resource/macos-later1.gif) -For macOS 10.14 devices, SwiftRater uses SKStoreReviewController. - -## 〜 macOS 10.14 -![SwiftRater2](./Resource/macos-later2.gif) - ## Requirements -iOS 8.0, macOS 10.10 or later, written in Swift. -Xcode 8.2 or later. +iOS 13.0, macOS 10.15 or later, written in Swift. +Xcode 16.0 or later. If you want to use Xcode 15, please use `2.1.3`. ## Installation diff --git a/SwiftRater.podspec b/SwiftRater.podspec index 94d7342..0ffc018 100644 --- a/SwiftRater.podspec +++ b/SwiftRater.podspec @@ -8,9 +8,9 @@ Pod::Spec.new do |s| s.name = 'SwiftRater' - s.version = '2.1.3' + s.version = '2.2.0' s.summary = 'A utility that reminds your iPhone app users to review the app written in pure Swift.' - s.platform = :ios, '12.0' + s.platform = :ios, '13.0' # This description is used to generate tags and improve search results. # * Think: What does it do? Why did you write it? What is the focus? @@ -28,7 +28,7 @@ SwiftRater is a class that you can drop into any iPhone app that will help remin s.author = { 'takecian' => 'takecian@gmail.com' } s.source = { :git => 'https://github.com/takecian/SwiftRater.git', :tag => s.version.to_s } s.social_media_url = 'https://takecian.github.io' - s.swift_version = '5.1' + s.swift_version = '6.0' s.source_files = 'SwiftRater/**/*' s.exclude_files = 'SwiftRater/**/*.{plist}' From a86155fedafa34695fac6c46d2461d081620396f Mon Sep 17 00:00:00 2001 From: Takeshi Fujiki Date: Sun, 3 Nov 2024 23:43:02 +0900 Subject: [PATCH 4/7] Update versions --- SwiftRater.xcodeproj/project.pbxproj | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/SwiftRater.xcodeproj/project.pbxproj b/SwiftRater.xcodeproj/project.pbxproj index 23fa75e..fea9054 100644 --- a/SwiftRater.xcodeproj/project.pbxproj +++ b/SwiftRater.xcodeproj/project.pbxproj @@ -475,7 +475,7 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = SwiftRater/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.takecian.SwiftRater; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -499,7 +499,7 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = SwiftRater/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.takecian.SwiftRater; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -515,12 +515,12 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; DEVELOPMENT_TEAM = XEV6645KTD; INFOPLIST_FILE = SwiftRaterTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.takecian.SwiftRaterTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_STRICT_CONCURRENCY = complete; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 6.0; }; name = Debug; }; @@ -530,12 +530,12 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; DEVELOPMENT_TEAM = XEV6645KTD; INFOPLIST_FILE = SwiftRaterTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.takecian.SwiftRaterTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_STRICT_CONCURRENCY = complete; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 6.0; }; name = Release; }; From 23cfb304c75ff76f6dbd2ffb7d54d9e59bce0a12 Mon Sep 17 00:00:00 2001 From: Takeshi Fujiki Date: Sun, 3 Nov 2024 23:55:31 +0900 Subject: [PATCH 5/7] Update versions --- Demo/Demo.xcodeproj/project.pbxproj | 12 ++++++------ Demo/Podfile | 2 +- DemoObjc/DemoObjc.xcodeproj/project.pbxproj | 15 +++++++-------- DemoObjc/DemoObjc/AppDelegate.m | 20 +++++++++++--------- DemoObjc/Podfile | 2 +- SwiftRater.xcodeproj/project.pbxproj | 4 ++-- 6 files changed, 28 insertions(+), 27 deletions(-) diff --git a/Demo/Demo.xcodeproj/project.pbxproj b/Demo/Demo.xcodeproj/project.pbxproj index aba2ead..4193fa0 100644 --- a/Demo/Demo.xcodeproj/project.pbxproj +++ b/Demo/Demo.xcodeproj/project.pbxproj @@ -457,7 +457,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -501,7 +501,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; @@ -518,7 +518,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEVELOPMENT_TEAM = 495G5CPHRQ; INFOPLIST_FILE = Demo/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 15.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.cocomoe.carp; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -538,7 +538,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEVELOPMENT_TEAM = 495G5CPHRQ; INFOPLIST_FILE = Demo/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 15.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.cocomoe.carp; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -555,7 +555,7 @@ BUNDLE_LOADER = "$(TEST_HOST)"; DEVELOPMENT_TEAM = XEV6645KTD; INFOPLIST_FILE = DemoTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 15.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.takecian.DemoTests; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -572,7 +572,7 @@ BUNDLE_LOADER = "$(TEST_HOST)"; DEVELOPMENT_TEAM = XEV6645KTD; INFOPLIST_FILE = DemoTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 15.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.takecian.DemoTests; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/Demo/Podfile b/Demo/Podfile index 1579f78..e8b0dd2 100644 --- a/Demo/Podfile +++ b/Demo/Podfile @@ -1,4 +1,4 @@ -platform :ios, '15.0' +platform :ios, '13.0' use_frameworks! target 'Demo' do diff --git a/DemoObjc/DemoObjc.xcodeproj/project.pbxproj b/DemoObjc/DemoObjc.xcodeproj/project.pbxproj index 1e3c549..c449068 100644 --- a/DemoObjc/DemoObjc.xcodeproj/project.pbxproj +++ b/DemoObjc/DemoObjc.xcodeproj/project.pbxproj @@ -186,17 +186,16 @@ buildActionMask = 2147483647; files = ( ); - inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-DemoObjc/Pods-DemoObjc-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/SwiftRater/SwiftRater.framework", + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-DemoObjc/Pods-DemoObjc-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftRater.framework", + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-DemoObjc/Pods-DemoObjc-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-DemoObjc/Pods-DemoObjc-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-DemoObjc/Pods-DemoObjc-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -285,7 +284,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -337,7 +336,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; diff --git a/DemoObjc/DemoObjc/AppDelegate.m b/DemoObjc/DemoObjc/AppDelegate.m index cc26202..50e6f4a 100644 --- a/DemoObjc/DemoObjc/AppDelegate.m +++ b/DemoObjc/DemoObjc/AppDelegate.m @@ -17,15 +17,17 @@ @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - SwiftRater.daysUntilPrompt = 1; - SwiftRater.usesUntilPrompt = 1; - SwiftRater.daysBeforeReminding = 1; - SwiftRater.showLaterButton = true; - SwiftRater.showLog = true; - // SwiftRater.debugMode = true // need to set false when submitting to AppStore!! - [SwiftRater appLaunched]; - - return YES; + SwiftRater.daysUntilPrompt = 1; + SwiftRater.usesUntilPrompt = 1; + SwiftRater.daysBeforeReminding = 1; + SwiftRater.showLaterButton = true; + SwiftRater.showLog = true; +// SwiftRater.appID = @"1104775712"; // Optional, if you don't set appId, SwiftRater try to get app id from appstore. +// SwiftRater.countryCode = @"fr"; // if your app is only avaiable for some coutnries, please add country code. +// SwiftRater.debugMode = true; // need to set false when submitting to AppStore!! + [SwiftRater appLaunched]; + + return YES; } @end diff --git a/DemoObjc/Podfile b/DemoObjc/Podfile index 05c1e95..99fcf2d 100644 --- a/DemoObjc/Podfile +++ b/DemoObjc/Podfile @@ -1,6 +1,6 @@ source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '11.0' +platform :ios, '13.0' use_frameworks! target 'DemoObjc' do diff --git a/SwiftRater.xcodeproj/project.pbxproj b/SwiftRater.xcodeproj/project.pbxproj index fea9054..70eb8cb 100644 --- a/SwiftRater.xcodeproj/project.pbxproj +++ b/SwiftRater.xcodeproj/project.pbxproj @@ -404,7 +404,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -452,7 +452,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; From 243ad8de8d7f59f43302d4f98f6bd2a28ff24756 Mon Sep 17 00:00:00 2001 From: Takeshi Fujiki Date: Sun, 3 Nov 2024 23:58:34 +0900 Subject: [PATCH 6/7] Update versions --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index 20722ef..d80a821 100644 --- a/Package.swift +++ b/Package.swift @@ -6,7 +6,7 @@ let package = Package( defaultLocalization: "en", platforms: [ .iOS(.v13), - .macOS(.v10_10) + .macOS(.v10_15) ], products: [ .library( From e87734f4228e7a00cf59fd78820ad1da8ab00c30 Mon Sep 17 00:00:00 2001 From: Takeshi Fujiki Date: Tue, 5 Nov 2024 21:37:13 +0900 Subject: [PATCH 7/7] Update README --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index aa15341..bda83b4 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,6 @@ SwiftRater is written in pure Swift. ## Requirements iOS 13.0, macOS 10.15 or later, written in Swift. -Xcode 16.0 or later. If you want to use Xcode 15, please use `2.1.3`. ## Installation