Skip to content

Commit 357425f

Browse files
authored
Release 3.0.2 (#69)
Release `3.0.2`
2 parents 2894d3a + 16958e6 commit 357425f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+93
-36
lines changed

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
All notable changes to this project will be documented in this file.
33

44
#### 3.x Releases
5-
- `3.0.x` Releases - [`3.0.0`](#300) | [`3.0.1`](#301)
5+
- `3.0.x` Releases - [`3.0.0`](#300) | [`3.0.1`](#301) | [`3.0.2`](#302)
66
- `3.0.0` Release Candidates - [`3.0.0-rc.1`](#300-rc1) | [`3.0.0-rc.2`](#300-rc2)
77

88
#### 2.x Releases
@@ -11,6 +11,17 @@ All notable changes to this project will be documented in this file.
1111
#### 1.x Releases
1212
- `1.0.x` Releases - [1.0.0](#100)
1313

14+
## [3.0.2](https://github.com/space-code/flare/releases/tag/3.0.2)
15+
Released on 2024-09-04.
16+
17+
## Added
18+
- Implement localizedPriceString for StoreProductDiscount & currencySymbol for StoreProduct
19+
- Added in Pull Request [#66](https://github.com/space-code/flare/pull/66).
20+
21+
## Fixed
22+
- Fix the code formatting
23+
- Fixed in Pull Request [#67](https://github.com/space-code/flare/pull/67)
24+
1425
## [3.0.1](https://github.com/space-code/flare/releases/tag/3.0.1)
1526
Released on 2024-08-09.
1627

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ GEM
4747
open4 (1.3.4)
4848
public_suffix (5.0.3)
4949
rchardet (1.8.0)
50-
rexml (3.3.3)
50+
rexml (3.3.6)
5151
strscan
5252
ruby2_keywords (0.0.5)
5353
sawyer (0.9.2)

Package.resolved

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sources/Flare/Classes/Extensions/Formatters/NumberFormatter+.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Flare
3-
// Copyright © 2023 Space Code. All rights reserved.
3+
// Copyright © 2024 Space Code. All rights reserved.
44
//
55

66
import Foundation

Sources/Flare/Classes/Extensions/Locale/Locale+CurrencyCode.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Flare
3-
// Copyright © 2023 Space Code. All rights reserved.
3+
// Copyright © 2024 Space Code. All rights reserved.
44
//
55

66
import Foundation

Sources/Flare/Classes/Extensions/ProductType+.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Flare
3-
// Copyright © 2023 Space Code. All rights reserved.
3+
// Copyright © 2024 Space Code. All rights reserved.
44
//
55

66
import Foundation

Sources/Flare/Classes/Extensions/SKRequest+Identifier.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import StoreKit
77

88
private var requestIdKey: UInt = 0
99

10-
internal extension SKRequest {
10+
extension SKRequest {
1111
var id: String {
1212
get {
1313
objc_getAssociatedObject(self, &requestIdKey) as? String ?? ""

Sources/Flare/Classes/Helpers/AsyncSequence/AsyncSequence+Stream.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Flare
3-
// Copyright © 2023 Space Code. All rights reserved.
3+
// Copyright © 2024 Space Code. All rights reserved.
44
//
55

66
import Foundation

Sources/Flare/Classes/Models/IAPError.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Flare
3-
// Copyright © 2024 Space Code. All rights reserved.
3+
// Copyright © 2023 Space Code. All rights reserved.
44
//
55

66
import StoreKit

Sources/Flare/Classes/Models/Internal/Protocols/ISKProduct.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ protocol ISKProduct {
1616
/// The currency code for the product's price.
1717
var currencyCode: String? { get }
1818

19+
/// The currency Symbol for the product's price.
20+
var currencySymbol: String? { get }
21+
1922
/// The price of the product in decimal format.
2023
var price: Decimal { get }
2124

Sources/Flare/Classes/Models/Internal/Protocols/IStoreProductDiscount.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ protocol IStoreProductDiscount: Sendable {
1818
/// The discounted price in the specified currency.
1919
var price: Decimal { get }
2020

21+
/// A localized string representing the price of the product.
22+
var localizedPriceString: String? { get }
23+
2124
/// The payment mode associated with the discount (e.g., freeTrial, payUpFront, payAsYouGo).
2225
var paymentMode: PaymentMode { get }
2326

Sources/Flare/Classes/Models/Internal/SK1StoreProduct.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ extension SK1StoreProduct: ISKProduct {
3939
product.priceLocale.currencyCodeID
4040
}
4141

42+
var currencySymbol: String? {
43+
numberFormatter.currencySymbol
44+
}
45+
4246
var price: Decimal {
4347
product.price as Decimal
4448
}

Sources/Flare/Classes/Models/Internal/SK1StoreProductDiscount.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ struct SK1StoreProductDiscount: IStoreProductDiscount {
2121
/// The discounted price in the specified currency.
2222
let price: Decimal
2323

24+
/// A localized string representing the price of the product.
25+
let localizedPriceString: String?
26+
2427
/// The payment mode associated with the discount (e.g., freeTrial, payUpFront, payAsYouGo).
2528
let paymentMode: PaymentMode
2629

@@ -56,5 +59,9 @@ struct SK1StoreProductDiscount: IStoreProductDiscount {
5659
self.subscriptionPeriod = subscriptionPeriod
5760
numberOfPeriods = productDiscount.numberOfPeriods
5861
type = discountType
62+
63+
/// The price formatter.
64+
let numberFormatter: NumberFormatter = .numberFormatter(with: self.productDiscount.priceLocale)
65+
localizedPriceString = numberFormatter.string(from: self.productDiscount.price)
5966
}
6067
}

Sources/Flare/Classes/Models/Internal/SK1StoreTransaction.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Flare
3-
// Copyright © 2023 Space Code. All rights reserved.
3+
// Copyright © 2024 Space Code. All rights reserved.
44
//
55

66
import StoreKit

Sources/Flare/Classes/Models/Internal/SK2StoreProduct.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ final class SK2StoreProduct {
2020
product.priceFormatStyle
2121
}
2222

23+
/// The price formatter.
24+
private lazy var numberFormatter: NumberFormatter = .numberFormatter(with: self.currencyFormat.locale)
25+
2326
// MARK: Initialization
2427

2528
init(_ product: StoreKit.Product) {
@@ -43,6 +46,10 @@ extension SK2StoreProduct: ISKProduct {
4346
currencyFormat.currencyCode
4447
}
4548

49+
var currencySymbol: String? {
50+
numberFormatter.currencySymbol
51+
}
52+
4653
var price: Decimal {
4754
product.price
4855
}

Sources/Flare/Classes/Models/Internal/SK2StoreProductDiscount.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ struct SK2StoreProductDiscount: IStoreProductDiscount, Sendable {
2222
/// The discounted price in the specified currency.
2323
let price: Decimal
2424

25+
/// A localized string representing the price of the product.
26+
let localizedPriceString: String?
27+
2528
/// The payment mode associated with the discount (e.g., freeTrial, payUpFront, payAsYouGo).
2629
let paymentMode: PaymentMode
2730

@@ -58,5 +61,6 @@ struct SK2StoreProductDiscount: IStoreProductDiscount, Sendable {
5861
self.subscriptionPeriod = subscriptionPeriod
5962
numberOfPeriods = subscriptionOffer.periodCount
6063
type = discountType
64+
localizedPriceString = subscriptionOffer.displayPrice
6165
}
6266
}

Sources/Flare/Classes/Models/Internal/StoreEnvironment.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Flare
3-
// Copyright © 2023 Space Code. All rights reserved.
3+
// Copyright © 2024 Space Code. All rights reserved.
44
//
55

66
import Foundation

Sources/Flare/Classes/Models/ProductType.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Flare
3-
// Copyright © 2023 Space Code. All rights reserved.
3+
// Copyright © 2024 Space Code. All rights reserved.
44
//
55

66
import Foundation

Sources/Flare/Classes/Models/StoreProduct.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ extension StoreProduct: ISKProduct {
6262
product.currencyCode
6363
}
6464

65+
public var currencySymbol: String? {
66+
product.currencySymbol
67+
}
68+
6569
public var price: Decimal {
6670
product.price
6771
}

Sources/Flare/Classes/Models/StoreProductDiscount.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ extension StoreProductDiscount: IStoreProductDiscount {
6464
discount.price
6565
}
6666

67+
public var localizedPriceString: String? {
68+
discount.localizedPriceString
69+
}
70+
6771
public var paymentMode: PaymentMode {
6872
discount.paymentMode
6973
}

Sources/Flare/Classes/Providers/PaymentProvider/PaymentProvider.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Flare
3-
// Copyright © 2024 Space Code. All rights reserved.
3+
// Copyright © 2023 Space Code. All rights reserved.
44
//
55

66
import Concurrency

Sources/Flare/Classes/Providers/ProductProvider/IProductProvider.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Flare
3-
// Copyright © 2024 Space Code. All rights reserved.
3+
// Copyright © 2023 Space Code. All rights reserved.
44
//
55

66
import StoreKit

Sources/Flare/Classes/Providers/ProductProvider/ProductProvider.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Flare
3-
// Copyright © 2024 Space Code. All rights reserved.
3+
// Copyright © 2023 Space Code. All rights reserved.
44
//
55

66
import Atomic

Sources/Flare/Classes/Providers/ReceiptRefreshProvider/ReceiptRefreshProvider.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Flare
3-
// Copyright © 2024 Space Code. All rights reserved.
3+
// Copyright © 2023 Space Code. All rights reserved.
44
//
55

66
import Concurrency

Sources/FlareMock/Mocks/ProductMock.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@ public final class ProductMock: ISKProduct {
3939
return stubbedCurrencyCode
4040
}
4141

42+
public var invokedCurrencySymbolGetter = false
43+
public var invokedCurrencySymbolGetterCount = 0
44+
public var stubbedCurrencySymbol: String!
45+
46+
public var currencySymbol: String? {
47+
invokedCurrencySymbolGetter = true
48+
invokedCurrencySymbolGetterCount += 1
49+
return stubbedCurrencySymbol
50+
}
51+
4252
public var invokedPriceGetter = false
4353
public var invokedPriceGetterCount = 0
4454
public var stubbedPrice: Decimal!

Tests/FlareTests/UnitTests/FlareTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Flare
3-
// Copyright © 2024 Space Code. All rights reserved.
3+
// Copyright © 2023 Space Code. All rights reserved.
44
//
55

66
@testable import Flare

Tests/FlareTests/UnitTests/Providers/IAPProviderTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Flare
3-
// Copyright © 2024 Space Code. All rights reserved.
3+
// Copyright © 2023 Space Code. All rights reserved.
44
//
55

66
@testable import Flare

Tests/FlareTests/UnitTests/Providers/ProductProviderTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Flare
3-
// Copyright © 2024 Space Code. All rights reserved.
3+
// Copyright © 2023 Space Code. All rights reserved.
44
//
55

66
import Concurrency

Tests/FlareTests/UnitTests/Providers/RefundRequestProviderTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Flare
3-
// Copyright © 2024 Space Code. All rights reserved.
3+
// Copyright © 2023 Space Code. All rights reserved.
44
//
55

66
@testable import Flare

Tests/FlareTests/UnitTests/TestHelpers/Extensions/Result+.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Flare
3-
// Copyright © 2023 Space Code. All rights reserved.
3+
// Copyright © 2024 Space Code. All rights reserved.
44
//
55

66
import Foundation

Tests/FlareTests/UnitTests/TestHelpers/Extensions/XCTestCase+.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Flare
3-
// Copyright © 2023 Space Code. All rights reserved.
3+
// Copyright © 2024 Space Code. All rights reserved.
44
//
55

66
import XCTest

Tests/FlareTests/UnitTests/TestHelpers/Fakes/StoreTransactionFake.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Flare
3-
// Copyright © 2023 Space Code. All rights reserved.
3+
// Copyright © 2024 Space Code. All rights reserved.
44
//
55

66
@testable import Flare

Tests/FlareTests/UnitTests/TestHelpers/Helpers/AvailabilityChecker.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Flare
3-
// Copyright © 2023 Space Code. All rights reserved.
3+
// Copyright © 2024 Space Code. All rights reserved.
44
//
55

66
import XCTest

Tests/FlareTests/UnitTests/TestHelpers/Helpers/PurchaseManagerTestHelper.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Flare
3-
// Copyright © 2024 Space Code. All rights reserved.
3+
// Copyright © 2023 Space Code. All rights reserved.
44
//
55

66
@testable import Flare

Tests/FlareTests/UnitTests/TestHelpers/Helpers/WindowSceneFactory.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
//
22
// Flare
3-
// Copyright © 2023 Space Code. All rights reserved.
3+
// Copyright © 2024 Space Code. All rights reserved.
44
//
55

66
#if os(iOS) || VISION_OS
77
import UIKit
88

9-
final class WindowSceneFactory {
9+
enum WindowSceneFactory {
1010
static func makeWindowScene() -> UIWindowScene {
1111
UIApplication.shared.connectedScenes.first as! UIWindowScene
1212
}

Tests/FlareTests/UnitTests/TestHelpers/Mocks/SKProductMock.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Flare
3-
// Copyright © 2024 Space Code. All rights reserved.
3+
// Copyright © 2023 Space Code. All rights reserved.
44
//
55

66
import StoreKit

Tests/FlareTests/UnitTests/TestHelpers/Mocks/StoreTransactionMock.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Flare
3-
// Copyright © 2023 Space Code. All rights reserved.
3+
// Copyright © 2024 Space Code. All rights reserved.
44
//
55

66
@testable import Flare

Tests/FlareTests/UnitTests/TestHelpers/Stubs/StoreTransactionStub.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Flare
3-
// Copyright © 2023 Space Code. All rights reserved.
3+
// Copyright © 2024 Space Code. All rights reserved.
44
//
55

66
@testable import Flare

0 commit comments

Comments
 (0)