From 0b6cd62979454f29a21f0d843bf69e70331eefbc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 09:59:50 +0400 Subject: [PATCH 1/6] Bump github.com/apple/swift-docc-plugin from 1.3.0 to 1.4.1 (#64) Bumps [github.com/apple/swift-docc-plugin](https://github.com/apple/swift-docc-plugin) from 1.3.0 to 1.4.1. - [Release notes](https://github.com/apple/swift-docc-plugin/releases) - [Commits](https://github.com/apple/swift-docc-plugin/compare/1.3.0...1.4.1) --- updated-dependencies: - dependency-name: github.com/apple/swift-docc-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Package.resolved | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Package.resolved b/Package.resolved index 9478aa8ff..04ad4723f 100644 --- a/Package.resolved +++ b/Package.resolved @@ -32,14 +32,14 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-docc-plugin", "state" : { - "revision" : "26ac5758409154cc448d7ab82389c520fa8a8247", - "version" : "1.3.0" + "revision" : "0510d9160330025fb5823f7845c26af3cd56a405", + "version" : "1.4.1" } }, { "identity" : "swift-docc-symbolkit", "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-docc-symbolkit", + "location" : "https://github.com/swiftlang/swift-docc-symbolkit", "state" : { "revision" : "b45d1f2ed151d057b54504d653e0da5552844e34", "version" : "1.0.0" From 308966ca90ad098b98adc35574611481f54e8df0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 16:03:26 +0400 Subject: [PATCH 2/6] Bump rexml from 3.3.3 to 3.3.6 (#63) Bumps [rexml](https://github.com/ruby/rexml) from 3.3.3 to 3.3.6. - [Release notes](https://github.com/ruby/rexml/releases) - [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md) - [Commits](https://github.com/ruby/rexml/compare/v3.3.3...v3.3.6) --- updated-dependencies: - dependency-name: rexml dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index e25445e09..cba0a7f21 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -47,7 +47,7 @@ GEM open4 (1.3.4) public_suffix (5.0.3) rchardet (1.8.0) - rexml (3.3.3) + rexml (3.3.6) strscan ruby2_keywords (0.0.5) sawyer (0.9.2) From 3146a1e589252f7a7b320fc560f039a4f39e3c2b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Sep 2024 23:45:53 +0700 Subject: [PATCH 3/6] Bump github.com/apple/swift-docc-plugin from 1.4.1 to 1.4.2 (#65) Bumps [github.com/apple/swift-docc-plugin](https://github.com/apple/swift-docc-plugin) from 1.4.1 to 1.4.2. - [Release notes](https://github.com/apple/swift-docc-plugin/releases) - [Commits](https://github.com/apple/swift-docc-plugin/compare/1.4.1...1.4.2) --- updated-dependencies: - dependency-name: github.com/apple/swift-docc-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Package.resolved | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Package.resolved b/Package.resolved index 04ad4723f..472689c67 100644 --- a/Package.resolved +++ b/Package.resolved @@ -32,8 +32,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-docc-plugin", "state" : { - "revision" : "0510d9160330025fb5823f7845c26af3cd56a405", - "version" : "1.4.1" + "revision" : "2eb22993b3dfd0c0d32729b357c8dabb6cd44680", + "version" : "1.4.2" } }, { From a7352a1d0ef2b20f34020dec80f6a7d8ecfc5a5a Mon Sep 17 00:00:00 2001 From: zhang Date: Tue, 3 Sep 2024 22:12:21 +0800 Subject: [PATCH 4/6] feat: product currencySymbol and ProductDiscount localizedPriceString (#66) * feat: currencySymbol and toreProductDiscount localizedPriceString * update changelog.md --------- Co-authored-by: zhangyu --- CHANGELOG.md | 5 +++++ .../Classes/Models/Internal/Protocols/ISKProduct.swift | 3 +++ .../Internal/Protocols/IStoreProductDiscount.swift | 3 +++ .../Classes/Models/Internal/SK1StoreProduct.swift | 4 ++++ .../Models/Internal/SK1StoreProductDiscount.swift | 7 +++++++ .../Classes/Models/Internal/SK2StoreProduct.swift | 7 +++++++ .../Models/Internal/SK2StoreProductDiscount.swift | 4 ++++ Sources/Flare/Classes/Models/StoreProduct.swift | 4 ++++ .../Flare/Classes/Models/StoreProductDiscount.swift | 4 ++++ Sources/FlareMock/Mocks/ProductMock.swift | 10 ++++++++++ 10 files changed, 51 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d72fbc1dc..bf7c61a3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,11 @@ All notable changes to this project will be documented in this file. #### 1.x Releases - `1.0.x` Releases - [1.0.0](#100) +## Added +- Implement localizedPriceString for StoreProductDiscount +- Implement currencySymbol for StoreProduct + - Added in Pull Request [#66](https://github.com/space-code/flare/pull/66). + ## [3.0.1](https://github.com/space-code/flare/releases/tag/3.0.1) Released on 2024-08-09. diff --git a/Sources/Flare/Classes/Models/Internal/Protocols/ISKProduct.swift b/Sources/Flare/Classes/Models/Internal/Protocols/ISKProduct.swift index 95f96964e..fd574c2c7 100644 --- a/Sources/Flare/Classes/Models/Internal/Protocols/ISKProduct.swift +++ b/Sources/Flare/Classes/Models/Internal/Protocols/ISKProduct.swift @@ -15,6 +15,9 @@ protocol ISKProduct { /// The currency code for the product's price. var currencyCode: String? { get } + + /// The currency Symbol for the product's price. + var currencySymbol: String? { get } /// The price of the product in decimal format. var price: Decimal { get } diff --git a/Sources/Flare/Classes/Models/Internal/Protocols/IStoreProductDiscount.swift b/Sources/Flare/Classes/Models/Internal/Protocols/IStoreProductDiscount.swift index 903ba0cfa..cb2fcaa2a 100644 --- a/Sources/Flare/Classes/Models/Internal/Protocols/IStoreProductDiscount.swift +++ b/Sources/Flare/Classes/Models/Internal/Protocols/IStoreProductDiscount.swift @@ -17,6 +17,9 @@ protocol IStoreProductDiscount: Sendable { /// The discounted price in the specified currency. var price: Decimal { get } + + /// A localized string representing the price of the product. + var localizedPriceString: String? { get } /// The payment mode associated with the discount (e.g., freeTrial, payUpFront, payAsYouGo). var paymentMode: PaymentMode { get } diff --git a/Sources/Flare/Classes/Models/Internal/SK1StoreProduct.swift b/Sources/Flare/Classes/Models/Internal/SK1StoreProduct.swift index a118e5bb7..57191ae65 100644 --- a/Sources/Flare/Classes/Models/Internal/SK1StoreProduct.swift +++ b/Sources/Flare/Classes/Models/Internal/SK1StoreProduct.swift @@ -38,6 +38,10 @@ extension SK1StoreProduct: ISKProduct { var currencyCode: String? { product.priceLocale.currencyCodeID } + + var currencySymbol: String? { + numberFormatter.currencySymbol + } var price: Decimal { product.price as Decimal diff --git a/Sources/Flare/Classes/Models/Internal/SK1StoreProductDiscount.swift b/Sources/Flare/Classes/Models/Internal/SK1StoreProductDiscount.swift index 263bee9d2..1c2899cab 100644 --- a/Sources/Flare/Classes/Models/Internal/SK1StoreProductDiscount.swift +++ b/Sources/Flare/Classes/Models/Internal/SK1StoreProductDiscount.swift @@ -20,6 +20,9 @@ struct SK1StoreProductDiscount: IStoreProductDiscount { /// The discounted price in the specified currency. let price: Decimal + + /// A localized string representing the price of the product. + let localizedPriceString: String? /// The payment mode associated with the discount (e.g., freeTrial, payUpFront, payAsYouGo). let paymentMode: PaymentMode @@ -56,5 +59,9 @@ struct SK1StoreProductDiscount: IStoreProductDiscount { self.subscriptionPeriod = subscriptionPeriod numberOfPeriods = productDiscount.numberOfPeriods type = discountType + + /// The price formatter. + let numberFormatter: NumberFormatter = .numberFormatter(with: self.productDiscount.priceLocale) + localizedPriceString = numberFormatter.string(from: self.productDiscount.price) } } diff --git a/Sources/Flare/Classes/Models/Internal/SK2StoreProduct.swift b/Sources/Flare/Classes/Models/Internal/SK2StoreProduct.swift index d9a1d4e46..9dbb4ddb4 100644 --- a/Sources/Flare/Classes/Models/Internal/SK2StoreProduct.swift +++ b/Sources/Flare/Classes/Models/Internal/SK2StoreProduct.swift @@ -19,6 +19,9 @@ final class SK2StoreProduct { private var currencyFormat: Decimal.FormatStyle.Currency { product.priceFormatStyle } + + /// The price formatter. + private lazy var numberFormatter: NumberFormatter = .numberFormatter(with: self.currencyFormat.locale) // MARK: Initialization @@ -42,6 +45,10 @@ extension SK2StoreProduct: ISKProduct { var currencyCode: String? { currencyFormat.currencyCode } + + var currencySymbol: String? { + numberFormatter.currencySymbol + } var price: Decimal { product.price diff --git a/Sources/Flare/Classes/Models/Internal/SK2StoreProductDiscount.swift b/Sources/Flare/Classes/Models/Internal/SK2StoreProductDiscount.swift index f38ba0cef..3d740ba9a 100644 --- a/Sources/Flare/Classes/Models/Internal/SK2StoreProductDiscount.swift +++ b/Sources/Flare/Classes/Models/Internal/SK2StoreProductDiscount.swift @@ -21,6 +21,9 @@ struct SK2StoreProductDiscount: IStoreProductDiscount, Sendable { /// The discounted price in the specified currency. let price: Decimal + + /// A localized string representing the price of the product. + let localizedPriceString: String? /// The payment mode associated with the discount (e.g., freeTrial, payUpFront, payAsYouGo). let paymentMode: PaymentMode @@ -58,5 +61,6 @@ struct SK2StoreProductDiscount: IStoreProductDiscount, Sendable { self.subscriptionPeriod = subscriptionPeriod numberOfPeriods = subscriptionOffer.periodCount type = discountType + localizedPriceString = subscriptionOffer.displayPrice } } diff --git a/Sources/Flare/Classes/Models/StoreProduct.swift b/Sources/Flare/Classes/Models/StoreProduct.swift index 306784694..1aa032d97 100644 --- a/Sources/Flare/Classes/Models/StoreProduct.swift +++ b/Sources/Flare/Classes/Models/StoreProduct.swift @@ -61,6 +61,10 @@ extension StoreProduct: ISKProduct { public var currencyCode: String? { product.currencyCode } + + public var currencySymbol: String? { + product.currencySymbol + } public var price: Decimal { product.price diff --git a/Sources/Flare/Classes/Models/StoreProductDiscount.swift b/Sources/Flare/Classes/Models/StoreProductDiscount.swift index 871755058..9bf70e18e 100644 --- a/Sources/Flare/Classes/Models/StoreProductDiscount.swift +++ b/Sources/Flare/Classes/Models/StoreProductDiscount.swift @@ -63,6 +63,10 @@ extension StoreProductDiscount: IStoreProductDiscount { public var price: Decimal { discount.price } + + public var localizedPriceString: String? { + discount.localizedPriceString + } public var paymentMode: PaymentMode { discount.paymentMode diff --git a/Sources/FlareMock/Mocks/ProductMock.swift b/Sources/FlareMock/Mocks/ProductMock.swift index 18db19af9..efef43255 100644 --- a/Sources/FlareMock/Mocks/ProductMock.swift +++ b/Sources/FlareMock/Mocks/ProductMock.swift @@ -38,6 +38,16 @@ public final class ProductMock: ISKProduct { invokedCurrencyCodeGetterCount += 1 return stubbedCurrencyCode } + + public var invokedCurrencySymbolGetter = false + public var invokedCurrencySymbolGetterCount = 0 + public var stubbedCurrencySymbol: String! + + public var currencySymbol: String? { + invokedCurrencySymbolGetter = true + invokedCurrencySymbolGetterCount += 1 + return stubbedCurrencySymbol + } public var invokedPriceGetter = false public var invokedPriceGetterCount = 0 From 13606bf461d233827dc2518c54555c1c6a71cbb0 Mon Sep 17 00:00:00 2001 From: Nikita Vasilev Date: Wed, 4 Sep 2024 11:09:47 +0700 Subject: [PATCH 5/6] Update the code formatting (#67) * Update the code formatting * Update `CHANGELOG.md` --- CHANGELOG.md | 4 ++++ .../Classes/Extensions/Formatters/NumberFormatter+.swift | 2 +- .../Flare/Classes/Extensions/Locale/Locale+CurrencyCode.swift | 2 +- Sources/Flare/Classes/Extensions/ProductType+.swift | 2 +- Sources/Flare/Classes/Extensions/SKRequest+Identifier.swift | 2 +- .../Classes/Helpers/AsyncSequence/AsyncSequence+Stream.swift | 2 +- Sources/Flare/Classes/Models/IAPError.swift | 2 +- .../Flare/Classes/Models/Internal/Protocols/ISKProduct.swift | 2 +- .../Models/Internal/Protocols/IStoreProductDiscount.swift | 2 +- Sources/Flare/Classes/Models/Internal/SK1StoreProduct.swift | 2 +- .../Classes/Models/Internal/SK1StoreProductDiscount.swift | 4 ++-- .../Flare/Classes/Models/Internal/SK1StoreTransaction.swift | 2 +- Sources/Flare/Classes/Models/Internal/SK2StoreProduct.swift | 4 ++-- .../Classes/Models/Internal/SK2StoreProductDiscount.swift | 2 +- Sources/Flare/Classes/Models/Internal/StoreEnvironment.swift | 2 +- Sources/Flare/Classes/Models/ProductType.swift | 2 +- Sources/Flare/Classes/Models/StoreProduct.swift | 2 +- Sources/Flare/Classes/Models/StoreProductDiscount.swift | 2 +- .../Classes/Providers/PaymentProvider/PaymentProvider.swift | 2 +- .../Classes/Providers/ProductProvider/IProductProvider.swift | 2 +- .../Classes/Providers/ProductProvider/ProductProvider.swift | 2 +- .../ReceiptRefreshProvider/ReceiptRefreshProvider.swift | 2 +- Sources/FlareMock/Mocks/ProductMock.swift | 4 ++-- Tests/FlareTests/UnitTests/FlareTests.swift | 2 +- Tests/FlareTests/UnitTests/Providers/IAPProviderTests.swift | 2 +- .../FlareTests/UnitTests/Providers/ProductProviderTests.swift | 2 +- .../UnitTests/Providers/RefundRequestProviderTests.swift | 2 +- .../FlareTests/UnitTests/TestHelpers/Extensions/Result+.swift | 2 +- .../UnitTests/TestHelpers/Extensions/XCTestCase+.swift | 2 +- .../UnitTests/TestHelpers/Fakes/StoreTransactionFake.swift | 2 +- .../UnitTests/TestHelpers/Helpers/AvailabilityChecker.swift | 2 +- .../TestHelpers/Helpers/PurchaseManagerTestHelper.swift | 2 +- .../UnitTests/TestHelpers/Helpers/WindowSceneFactory.swift | 4 ++-- .../UnitTests/TestHelpers/Mocks/SKProductMock.swift | 2 +- .../UnitTests/TestHelpers/Mocks/StoreTransactionMock.swift | 2 +- .../UnitTests/TestHelpers/Stubs/StoreTransactionStub.swift | 2 +- .../Subscriptions/SubscriptionsPresenterTests.swift | 2 +- Tests/IntegrationTests/Helpers/Extensions/Result+.swift | 2 +- Tests/IntegrationTests/Helpers/Extensions/XCTestCase+.swift | 2 +- Tests/UnitTestHostApp/AppDelegate.swift | 2 +- 40 files changed, 47 insertions(+), 43 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf7c61a3a..3a6995896 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,10 @@ All notable changes to this project will be documented in this file. - Implement currencySymbol for StoreProduct - Added in Pull Request [#66](https://github.com/space-code/flare/pull/66). +## Fixed +- Fix the code formatting + - Fixed in Pull Request [#67](https://github.com/space-code/flare/pull/67) + ## [3.0.1](https://github.com/space-code/flare/releases/tag/3.0.1) Released on 2024-08-09. diff --git a/Sources/Flare/Classes/Extensions/Formatters/NumberFormatter+.swift b/Sources/Flare/Classes/Extensions/Formatters/NumberFormatter+.swift index c044972af..22f285a7e 100644 --- a/Sources/Flare/Classes/Extensions/Formatters/NumberFormatter+.swift +++ b/Sources/Flare/Classes/Extensions/Formatters/NumberFormatter+.swift @@ -1,6 +1,6 @@ // // Flare -// Copyright © 2023 Space Code. All rights reserved. +// Copyright © 2024 Space Code. All rights reserved. // import Foundation diff --git a/Sources/Flare/Classes/Extensions/Locale/Locale+CurrencyCode.swift b/Sources/Flare/Classes/Extensions/Locale/Locale+CurrencyCode.swift index c54b4cccc..2a9ce363e 100644 --- a/Sources/Flare/Classes/Extensions/Locale/Locale+CurrencyCode.swift +++ b/Sources/Flare/Classes/Extensions/Locale/Locale+CurrencyCode.swift @@ -1,6 +1,6 @@ // // Flare -// Copyright © 2023 Space Code. All rights reserved. +// Copyright © 2024 Space Code. All rights reserved. // import Foundation diff --git a/Sources/Flare/Classes/Extensions/ProductType+.swift b/Sources/Flare/Classes/Extensions/ProductType+.swift index 73c936ca6..9b1082ebe 100644 --- a/Sources/Flare/Classes/Extensions/ProductType+.swift +++ b/Sources/Flare/Classes/Extensions/ProductType+.swift @@ -1,6 +1,6 @@ // // Flare -// Copyright © 2023 Space Code. All rights reserved. +// Copyright © 2024 Space Code. All rights reserved. // import Foundation diff --git a/Sources/Flare/Classes/Extensions/SKRequest+Identifier.swift b/Sources/Flare/Classes/Extensions/SKRequest+Identifier.swift index bb12c0150..9d34aa897 100644 --- a/Sources/Flare/Classes/Extensions/SKRequest+Identifier.swift +++ b/Sources/Flare/Classes/Extensions/SKRequest+Identifier.swift @@ -7,7 +7,7 @@ import StoreKit private var requestIdKey: UInt = 0 -internal extension SKRequest { +extension SKRequest { var id: String { get { objc_getAssociatedObject(self, &requestIdKey) as? String ?? "" diff --git a/Sources/Flare/Classes/Helpers/AsyncSequence/AsyncSequence+Stream.swift b/Sources/Flare/Classes/Helpers/AsyncSequence/AsyncSequence+Stream.swift index ef1f60823..aa630ddc5 100644 --- a/Sources/Flare/Classes/Helpers/AsyncSequence/AsyncSequence+Stream.swift +++ b/Sources/Flare/Classes/Helpers/AsyncSequence/AsyncSequence+Stream.swift @@ -1,6 +1,6 @@ // // Flare -// Copyright © 2023 Space Code. All rights reserved. +// Copyright © 2024 Space Code. All rights reserved. // import Foundation diff --git a/Sources/Flare/Classes/Models/IAPError.swift b/Sources/Flare/Classes/Models/IAPError.swift index 0de5a9262..93dd895fe 100644 --- a/Sources/Flare/Classes/Models/IAPError.swift +++ b/Sources/Flare/Classes/Models/IAPError.swift @@ -1,6 +1,6 @@ // // Flare -// Copyright © 2024 Space Code. All rights reserved. +// Copyright © 2023 Space Code. All rights reserved. // import StoreKit diff --git a/Sources/Flare/Classes/Models/Internal/Protocols/ISKProduct.swift b/Sources/Flare/Classes/Models/Internal/Protocols/ISKProduct.swift index fd574c2c7..f37511d09 100644 --- a/Sources/Flare/Classes/Models/Internal/Protocols/ISKProduct.swift +++ b/Sources/Flare/Classes/Models/Internal/Protocols/ISKProduct.swift @@ -15,7 +15,7 @@ protocol ISKProduct { /// The currency code for the product's price. var currencyCode: String? { get } - + /// The currency Symbol for the product's price. var currencySymbol: String? { get } diff --git a/Sources/Flare/Classes/Models/Internal/Protocols/IStoreProductDiscount.swift b/Sources/Flare/Classes/Models/Internal/Protocols/IStoreProductDiscount.swift index cb2fcaa2a..dd6009ee8 100644 --- a/Sources/Flare/Classes/Models/Internal/Protocols/IStoreProductDiscount.swift +++ b/Sources/Flare/Classes/Models/Internal/Protocols/IStoreProductDiscount.swift @@ -17,7 +17,7 @@ protocol IStoreProductDiscount: Sendable { /// The discounted price in the specified currency. var price: Decimal { get } - + /// A localized string representing the price of the product. var localizedPriceString: String? { get } diff --git a/Sources/Flare/Classes/Models/Internal/SK1StoreProduct.swift b/Sources/Flare/Classes/Models/Internal/SK1StoreProduct.swift index 57191ae65..06dd091ac 100644 --- a/Sources/Flare/Classes/Models/Internal/SK1StoreProduct.swift +++ b/Sources/Flare/Classes/Models/Internal/SK1StoreProduct.swift @@ -38,7 +38,7 @@ extension SK1StoreProduct: ISKProduct { var currencyCode: String? { product.priceLocale.currencyCodeID } - + var currencySymbol: String? { numberFormatter.currencySymbol } diff --git a/Sources/Flare/Classes/Models/Internal/SK1StoreProductDiscount.swift b/Sources/Flare/Classes/Models/Internal/SK1StoreProductDiscount.swift index 1c2899cab..952c25188 100644 --- a/Sources/Flare/Classes/Models/Internal/SK1StoreProductDiscount.swift +++ b/Sources/Flare/Classes/Models/Internal/SK1StoreProductDiscount.swift @@ -20,7 +20,7 @@ struct SK1StoreProductDiscount: IStoreProductDiscount { /// The discounted price in the specified currency. let price: Decimal - + /// A localized string representing the price of the product. let localizedPriceString: String? @@ -59,7 +59,7 @@ struct SK1StoreProductDiscount: IStoreProductDiscount { self.subscriptionPeriod = subscriptionPeriod numberOfPeriods = productDiscount.numberOfPeriods type = discountType - + /// The price formatter. let numberFormatter: NumberFormatter = .numberFormatter(with: self.productDiscount.priceLocale) localizedPriceString = numberFormatter.string(from: self.productDiscount.price) diff --git a/Sources/Flare/Classes/Models/Internal/SK1StoreTransaction.swift b/Sources/Flare/Classes/Models/Internal/SK1StoreTransaction.swift index e7f02aa29..ae44b14a5 100644 --- a/Sources/Flare/Classes/Models/Internal/SK1StoreTransaction.swift +++ b/Sources/Flare/Classes/Models/Internal/SK1StoreTransaction.swift @@ -1,6 +1,6 @@ // // Flare -// Copyright © 2023 Space Code. All rights reserved. +// Copyright © 2024 Space Code. All rights reserved. // import StoreKit diff --git a/Sources/Flare/Classes/Models/Internal/SK2StoreProduct.swift b/Sources/Flare/Classes/Models/Internal/SK2StoreProduct.swift index 9dbb4ddb4..c874a02ce 100644 --- a/Sources/Flare/Classes/Models/Internal/SK2StoreProduct.swift +++ b/Sources/Flare/Classes/Models/Internal/SK2StoreProduct.swift @@ -19,7 +19,7 @@ final class SK2StoreProduct { private var currencyFormat: Decimal.FormatStyle.Currency { product.priceFormatStyle } - + /// The price formatter. private lazy var numberFormatter: NumberFormatter = .numberFormatter(with: self.currencyFormat.locale) @@ -45,7 +45,7 @@ extension SK2StoreProduct: ISKProduct { var currencyCode: String? { currencyFormat.currencyCode } - + var currencySymbol: String? { numberFormatter.currencySymbol } diff --git a/Sources/Flare/Classes/Models/Internal/SK2StoreProductDiscount.swift b/Sources/Flare/Classes/Models/Internal/SK2StoreProductDiscount.swift index 3d740ba9a..b98e9d4cb 100644 --- a/Sources/Flare/Classes/Models/Internal/SK2StoreProductDiscount.swift +++ b/Sources/Flare/Classes/Models/Internal/SK2StoreProductDiscount.swift @@ -21,7 +21,7 @@ struct SK2StoreProductDiscount: IStoreProductDiscount, Sendable { /// The discounted price in the specified currency. let price: Decimal - + /// A localized string representing the price of the product. let localizedPriceString: String? diff --git a/Sources/Flare/Classes/Models/Internal/StoreEnvironment.swift b/Sources/Flare/Classes/Models/Internal/StoreEnvironment.swift index 0744220ac..db41fb281 100644 --- a/Sources/Flare/Classes/Models/Internal/StoreEnvironment.swift +++ b/Sources/Flare/Classes/Models/Internal/StoreEnvironment.swift @@ -1,6 +1,6 @@ // // Flare -// Copyright © 2023 Space Code. All rights reserved. +// Copyright © 2024 Space Code. All rights reserved. // import Foundation diff --git a/Sources/Flare/Classes/Models/ProductType.swift b/Sources/Flare/Classes/Models/ProductType.swift index 482b86073..dceea7d6b 100644 --- a/Sources/Flare/Classes/Models/ProductType.swift +++ b/Sources/Flare/Classes/Models/ProductType.swift @@ -1,6 +1,6 @@ // // Flare -// Copyright © 2023 Space Code. All rights reserved. +// Copyright © 2024 Space Code. All rights reserved. // import Foundation diff --git a/Sources/Flare/Classes/Models/StoreProduct.swift b/Sources/Flare/Classes/Models/StoreProduct.swift index 1aa032d97..f6191d6f1 100644 --- a/Sources/Flare/Classes/Models/StoreProduct.swift +++ b/Sources/Flare/Classes/Models/StoreProduct.swift @@ -61,7 +61,7 @@ extension StoreProduct: ISKProduct { public var currencyCode: String? { product.currencyCode } - + public var currencySymbol: String? { product.currencySymbol } diff --git a/Sources/Flare/Classes/Models/StoreProductDiscount.swift b/Sources/Flare/Classes/Models/StoreProductDiscount.swift index 9bf70e18e..858f960e6 100644 --- a/Sources/Flare/Classes/Models/StoreProductDiscount.swift +++ b/Sources/Flare/Classes/Models/StoreProductDiscount.swift @@ -63,7 +63,7 @@ extension StoreProductDiscount: IStoreProductDiscount { public var price: Decimal { discount.price } - + public var localizedPriceString: String? { discount.localizedPriceString } diff --git a/Sources/Flare/Classes/Providers/PaymentProvider/PaymentProvider.swift b/Sources/Flare/Classes/Providers/PaymentProvider/PaymentProvider.swift index 0d681238e..8fc3bba75 100644 --- a/Sources/Flare/Classes/Providers/PaymentProvider/PaymentProvider.swift +++ b/Sources/Flare/Classes/Providers/PaymentProvider/PaymentProvider.swift @@ -1,6 +1,6 @@ // // Flare -// Copyright © 2024 Space Code. All rights reserved. +// Copyright © 2023 Space Code. All rights reserved. // import Concurrency diff --git a/Sources/Flare/Classes/Providers/ProductProvider/IProductProvider.swift b/Sources/Flare/Classes/Providers/ProductProvider/IProductProvider.swift index 55955ecf4..6b6f3e716 100644 --- a/Sources/Flare/Classes/Providers/ProductProvider/IProductProvider.swift +++ b/Sources/Flare/Classes/Providers/ProductProvider/IProductProvider.swift @@ -1,6 +1,6 @@ // // Flare -// Copyright © 2024 Space Code. All rights reserved. +// Copyright © 2023 Space Code. All rights reserved. // import StoreKit diff --git a/Sources/Flare/Classes/Providers/ProductProvider/ProductProvider.swift b/Sources/Flare/Classes/Providers/ProductProvider/ProductProvider.swift index 357229817..77c47434a 100644 --- a/Sources/Flare/Classes/Providers/ProductProvider/ProductProvider.swift +++ b/Sources/Flare/Classes/Providers/ProductProvider/ProductProvider.swift @@ -1,6 +1,6 @@ // // Flare -// Copyright © 2024 Space Code. All rights reserved. +// Copyright © 2023 Space Code. All rights reserved. // import Atomic diff --git a/Sources/Flare/Classes/Providers/ReceiptRefreshProvider/ReceiptRefreshProvider.swift b/Sources/Flare/Classes/Providers/ReceiptRefreshProvider/ReceiptRefreshProvider.swift index f5ec09957..fa84ac34b 100644 --- a/Sources/Flare/Classes/Providers/ReceiptRefreshProvider/ReceiptRefreshProvider.swift +++ b/Sources/Flare/Classes/Providers/ReceiptRefreshProvider/ReceiptRefreshProvider.swift @@ -1,6 +1,6 @@ // // Flare -// Copyright © 2024 Space Code. All rights reserved. +// Copyright © 2023 Space Code. All rights reserved. // import Concurrency diff --git a/Sources/FlareMock/Mocks/ProductMock.swift b/Sources/FlareMock/Mocks/ProductMock.swift index efef43255..49e62c562 100644 --- a/Sources/FlareMock/Mocks/ProductMock.swift +++ b/Sources/FlareMock/Mocks/ProductMock.swift @@ -38,11 +38,11 @@ public final class ProductMock: ISKProduct { invokedCurrencyCodeGetterCount += 1 return stubbedCurrencyCode } - + public var invokedCurrencySymbolGetter = false public var invokedCurrencySymbolGetterCount = 0 public var stubbedCurrencySymbol: String! - + public var currencySymbol: String? { invokedCurrencySymbolGetter = true invokedCurrencySymbolGetterCount += 1 diff --git a/Tests/FlareTests/UnitTests/FlareTests.swift b/Tests/FlareTests/UnitTests/FlareTests.swift index a116a97fc..9bd3075a5 100644 --- a/Tests/FlareTests/UnitTests/FlareTests.swift +++ b/Tests/FlareTests/UnitTests/FlareTests.swift @@ -1,6 +1,6 @@ // // Flare -// Copyright © 2024 Space Code. All rights reserved. +// Copyright © 2023 Space Code. All rights reserved. // @testable import Flare diff --git a/Tests/FlareTests/UnitTests/Providers/IAPProviderTests.swift b/Tests/FlareTests/UnitTests/Providers/IAPProviderTests.swift index 3db90c719..bfa5bfae5 100644 --- a/Tests/FlareTests/UnitTests/Providers/IAPProviderTests.swift +++ b/Tests/FlareTests/UnitTests/Providers/IAPProviderTests.swift @@ -1,6 +1,6 @@ // // Flare -// Copyright © 2024 Space Code. All rights reserved. +// Copyright © 2023 Space Code. All rights reserved. // @testable import Flare diff --git a/Tests/FlareTests/UnitTests/Providers/ProductProviderTests.swift b/Tests/FlareTests/UnitTests/Providers/ProductProviderTests.swift index 9b3bba729..b481d8268 100644 --- a/Tests/FlareTests/UnitTests/Providers/ProductProviderTests.swift +++ b/Tests/FlareTests/UnitTests/Providers/ProductProviderTests.swift @@ -1,6 +1,6 @@ // // Flare -// Copyright © 2024 Space Code. All rights reserved. +// Copyright © 2023 Space Code. All rights reserved. // import Concurrency diff --git a/Tests/FlareTests/UnitTests/Providers/RefundRequestProviderTests.swift b/Tests/FlareTests/UnitTests/Providers/RefundRequestProviderTests.swift index ef6acb2e8..73059b40b 100644 --- a/Tests/FlareTests/UnitTests/Providers/RefundRequestProviderTests.swift +++ b/Tests/FlareTests/UnitTests/Providers/RefundRequestProviderTests.swift @@ -1,6 +1,6 @@ // // Flare -// Copyright © 2024 Space Code. All rights reserved. +// Copyright © 2023 Space Code. All rights reserved. // @testable import Flare diff --git a/Tests/FlareTests/UnitTests/TestHelpers/Extensions/Result+.swift b/Tests/FlareTests/UnitTests/TestHelpers/Extensions/Result+.swift index 9c779804a..c4c3b1ac7 100644 --- a/Tests/FlareTests/UnitTests/TestHelpers/Extensions/Result+.swift +++ b/Tests/FlareTests/UnitTests/TestHelpers/Extensions/Result+.swift @@ -1,6 +1,6 @@ // // Flare -// Copyright © 2023 Space Code. All rights reserved. +// Copyright © 2024 Space Code. All rights reserved. // import Foundation diff --git a/Tests/FlareTests/UnitTests/TestHelpers/Extensions/XCTestCase+.swift b/Tests/FlareTests/UnitTests/TestHelpers/Extensions/XCTestCase+.swift index 8d55a0f50..3e1c6feef 100644 --- a/Tests/FlareTests/UnitTests/TestHelpers/Extensions/XCTestCase+.swift +++ b/Tests/FlareTests/UnitTests/TestHelpers/Extensions/XCTestCase+.swift @@ -1,6 +1,6 @@ // // Flare -// Copyright © 2023 Space Code. All rights reserved. +// Copyright © 2024 Space Code. All rights reserved. // import XCTest diff --git a/Tests/FlareTests/UnitTests/TestHelpers/Fakes/StoreTransactionFake.swift b/Tests/FlareTests/UnitTests/TestHelpers/Fakes/StoreTransactionFake.swift index 002b7311b..770aadcdd 100644 --- a/Tests/FlareTests/UnitTests/TestHelpers/Fakes/StoreTransactionFake.swift +++ b/Tests/FlareTests/UnitTests/TestHelpers/Fakes/StoreTransactionFake.swift @@ -1,6 +1,6 @@ // // Flare -// Copyright © 2023 Space Code. All rights reserved. +// Copyright © 2024 Space Code. All rights reserved. // @testable import Flare diff --git a/Tests/FlareTests/UnitTests/TestHelpers/Helpers/AvailabilityChecker.swift b/Tests/FlareTests/UnitTests/TestHelpers/Helpers/AvailabilityChecker.swift index 7cec99218..5031b62b4 100644 --- a/Tests/FlareTests/UnitTests/TestHelpers/Helpers/AvailabilityChecker.swift +++ b/Tests/FlareTests/UnitTests/TestHelpers/Helpers/AvailabilityChecker.swift @@ -1,6 +1,6 @@ // // Flare -// Copyright © 2023 Space Code. All rights reserved. +// Copyright © 2024 Space Code. All rights reserved. // import XCTest diff --git a/Tests/FlareTests/UnitTests/TestHelpers/Helpers/PurchaseManagerTestHelper.swift b/Tests/FlareTests/UnitTests/TestHelpers/Helpers/PurchaseManagerTestHelper.swift index 63201f958..e42841ffb 100644 --- a/Tests/FlareTests/UnitTests/TestHelpers/Helpers/PurchaseManagerTestHelper.swift +++ b/Tests/FlareTests/UnitTests/TestHelpers/Helpers/PurchaseManagerTestHelper.swift @@ -1,6 +1,6 @@ // // Flare -// Copyright © 2024 Space Code. All rights reserved. +// Copyright © 2023 Space Code. All rights reserved. // @testable import Flare diff --git a/Tests/FlareTests/UnitTests/TestHelpers/Helpers/WindowSceneFactory.swift b/Tests/FlareTests/UnitTests/TestHelpers/Helpers/WindowSceneFactory.swift index 4c21b2c38..2e53b23d5 100644 --- a/Tests/FlareTests/UnitTests/TestHelpers/Helpers/WindowSceneFactory.swift +++ b/Tests/FlareTests/UnitTests/TestHelpers/Helpers/WindowSceneFactory.swift @@ -1,12 +1,12 @@ // // Flare -// Copyright © 2023 Space Code. All rights reserved. +// Copyright © 2024 Space Code. All rights reserved. // #if os(iOS) || VISION_OS import UIKit - final class WindowSceneFactory { + enum WindowSceneFactory { static func makeWindowScene() -> UIWindowScene { UIApplication.shared.connectedScenes.first as! UIWindowScene } diff --git a/Tests/FlareTests/UnitTests/TestHelpers/Mocks/SKProductMock.swift b/Tests/FlareTests/UnitTests/TestHelpers/Mocks/SKProductMock.swift index 74e27fcb4..bf2db54f3 100644 --- a/Tests/FlareTests/UnitTests/TestHelpers/Mocks/SKProductMock.swift +++ b/Tests/FlareTests/UnitTests/TestHelpers/Mocks/SKProductMock.swift @@ -1,6 +1,6 @@ // // Flare -// Copyright © 2024 Space Code. All rights reserved. +// Copyright © 2023 Space Code. All rights reserved. // import StoreKit diff --git a/Tests/FlareTests/UnitTests/TestHelpers/Mocks/StoreTransactionMock.swift b/Tests/FlareTests/UnitTests/TestHelpers/Mocks/StoreTransactionMock.swift index 225e403ef..772c1b172 100644 --- a/Tests/FlareTests/UnitTests/TestHelpers/Mocks/StoreTransactionMock.swift +++ b/Tests/FlareTests/UnitTests/TestHelpers/Mocks/StoreTransactionMock.swift @@ -1,6 +1,6 @@ // // Flare -// Copyright © 2023 Space Code. All rights reserved. +// Copyright © 2024 Space Code. All rights reserved. // @testable import Flare diff --git a/Tests/FlareTests/UnitTests/TestHelpers/Stubs/StoreTransactionStub.swift b/Tests/FlareTests/UnitTests/TestHelpers/Stubs/StoreTransactionStub.swift index 7b8a0c7cb..516d7c05d 100644 --- a/Tests/FlareTests/UnitTests/TestHelpers/Stubs/StoreTransactionStub.swift +++ b/Tests/FlareTests/UnitTests/TestHelpers/Stubs/StoreTransactionStub.swift @@ -1,6 +1,6 @@ // // Flare -// Copyright © 2023 Space Code. All rights reserved. +// Copyright © 2024 Space Code. All rights reserved. // @testable import Flare diff --git a/Tests/FlareUITests/UnitTests/Presentation/Subscriptions/SubscriptionsPresenterTests.swift b/Tests/FlareUITests/UnitTests/Presentation/Subscriptions/SubscriptionsPresenterTests.swift index 63f2e4aeb..265d6d4ef 100644 --- a/Tests/FlareUITests/UnitTests/Presentation/Subscriptions/SubscriptionsPresenterTests.swift +++ b/Tests/FlareUITests/UnitTests/Presentation/Subscriptions/SubscriptionsPresenterTests.swift @@ -128,5 +128,5 @@ final class SubscriptionsPresenterTests: XCTestCase { // MARK: - Extensions private extension Array where Element == String { - static let ids: [String] = ["subscription"] + static let ids = ["subscription"] } diff --git a/Tests/IntegrationTests/Helpers/Extensions/Result+.swift b/Tests/IntegrationTests/Helpers/Extensions/Result+.swift index 9c779804a..c4c3b1ac7 100644 --- a/Tests/IntegrationTests/Helpers/Extensions/Result+.swift +++ b/Tests/IntegrationTests/Helpers/Extensions/Result+.swift @@ -1,6 +1,6 @@ // // Flare -// Copyright © 2023 Space Code. All rights reserved. +// Copyright © 2024 Space Code. All rights reserved. // import Foundation diff --git a/Tests/IntegrationTests/Helpers/Extensions/XCTestCase+.swift b/Tests/IntegrationTests/Helpers/Extensions/XCTestCase+.swift index 8d55a0f50..3e1c6feef 100644 --- a/Tests/IntegrationTests/Helpers/Extensions/XCTestCase+.swift +++ b/Tests/IntegrationTests/Helpers/Extensions/XCTestCase+.swift @@ -1,6 +1,6 @@ // // Flare -// Copyright © 2023 Space Code. All rights reserved. +// Copyright © 2024 Space Code. All rights reserved. // import XCTest diff --git a/Tests/UnitTestHostApp/AppDelegate.swift b/Tests/UnitTestHostApp/AppDelegate.swift index 4f3e9b07c..ec1ced010 100644 --- a/Tests/UnitTestHostApp/AppDelegate.swift +++ b/Tests/UnitTestHostApp/AppDelegate.swift @@ -1,6 +1,6 @@ // // Flare -// Copyright © 2023 Space Code. All rights reserved. +// Copyright © 2024 Space Code. All rights reserved. // import SwiftUI From 16958e672364ad8c205d1e45036e6db2cba336d8 Mon Sep 17 00:00:00 2001 From: Nikita Vasilev Date: Wed, 4 Sep 2024 11:25:44 +0700 Subject: [PATCH 6/6] Update `CHANGELOG.md` (#68) --- CHANGELOG.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a6995896..55c6ce61a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file. #### 3.x Releases -- `3.0.x` Releases - [`3.0.0`](#300) | [`3.0.1`](#301) +- `3.0.x` Releases - [`3.0.0`](#300) | [`3.0.1`](#301) | [`3.0.2`](#302) - `3.0.0` Release Candidates - [`3.0.0-rc.1`](#300-rc1) | [`3.0.0-rc.2`](#300-rc2) #### 2.x Releases @@ -11,9 +11,11 @@ All notable changes to this project will be documented in this file. #### 1.x Releases - `1.0.x` Releases - [1.0.0](#100) +## [3.0.2](https://github.com/space-code/flare/releases/tag/3.0.2) +Released on 2024-09-04. + ## Added -- Implement localizedPriceString for StoreProductDiscount -- Implement currencySymbol for StoreProduct +- Implement localizedPriceString for StoreProductDiscount & currencySymbol for StoreProduct - Added in Pull Request [#66](https://github.com/space-code/flare/pull/66). ## Fixed