Skip to content

Commit

Permalink
Release 3.0.2 (#69)
Browse files Browse the repository at this point in the history
Release `3.0.2`
  • Loading branch information
nik3212 authored Sep 4, 2024
2 parents 2894d3a + 16958e6 commit 357425f
Show file tree
Hide file tree
Showing 42 changed files with 93 additions and 36 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -11,6 +11,17 @@ 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 & 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.

Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-docc-plugin",
"state" : {
"revision" : "26ac5758409154cc448d7ab82389c520fa8a8247",
"version" : "1.3.0"
"revision" : "2eb22993b3dfd0c0d32729b357c8dabb6cd44680",
"version" : "1.4.2"
}
},
{
"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"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Flare
// Copyright © 2023 Space Code. All rights reserved.
// Copyright © 2024 Space Code. All rights reserved.
//

import Foundation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Flare
// Copyright © 2023 Space Code. All rights reserved.
// Copyright © 2024 Space Code. All rights reserved.
//

import Foundation
Expand Down
2 changes: 1 addition & 1 deletion Sources/Flare/Classes/Extensions/ProductType+.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Flare
// Copyright © 2023 Space Code. All rights reserved.
// Copyright © 2024 Space Code. All rights reserved.
//

import Foundation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?? ""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Flare
// Copyright © 2023 Space Code. All rights reserved.
// Copyright © 2024 Space Code. All rights reserved.
//

import Foundation
Expand Down
2 changes: 1 addition & 1 deletion Sources/Flare/Classes/Models/IAPError.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Flare
// Copyright © 2024 Space Code. All rights reserved.
// Copyright © 2023 Space Code. All rights reserved.
//

import StoreKit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,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 }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,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 }

Expand Down
4 changes: 4 additions & 0 deletions Sources/Flare/Classes/Models/Internal/SK1StoreProduct.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ extension SK1StoreProduct: ISKProduct {
product.priceLocale.currencyCodeID
}

var currencySymbol: String? {
numberFormatter.currencySymbol
}

var price: Decimal {
product.price as Decimal
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,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

Expand Down Expand Up @@ -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)
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Flare
// Copyright © 2023 Space Code. All rights reserved.
// Copyright © 2024 Space Code. All rights reserved.
//

import StoreKit
Expand Down
7 changes: 7 additions & 0 deletions Sources/Flare/Classes/Models/Internal/SK2StoreProduct.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ final class SK2StoreProduct {
product.priceFormatStyle
}

/// The price formatter.
private lazy var numberFormatter: NumberFormatter = .numberFormatter(with: self.currencyFormat.locale)

// MARK: Initialization

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

var currencySymbol: String? {
numberFormatter.currencySymbol
}

var price: Decimal {
product.price
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,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

Expand Down Expand Up @@ -58,5 +61,6 @@ struct SK2StoreProductDiscount: IStoreProductDiscount, Sendable {
self.subscriptionPeriod = subscriptionPeriod
numberOfPeriods = subscriptionOffer.periodCount
type = discountType
localizedPriceString = subscriptionOffer.displayPrice
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Flare
// Copyright © 2023 Space Code. All rights reserved.
// Copyright © 2024 Space Code. All rights reserved.
//

import Foundation
Expand Down
2 changes: 1 addition & 1 deletion Sources/Flare/Classes/Models/ProductType.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Flare
// Copyright © 2023 Space Code. All rights reserved.
// Copyright © 2024 Space Code. All rights reserved.
//

import Foundation
Expand Down
4 changes: 4 additions & 0 deletions Sources/Flare/Classes/Models/StoreProduct.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ extension StoreProduct: ISKProduct {
product.currencyCode
}

public var currencySymbol: String? {
product.currencySymbol
}

public var price: Decimal {
product.price
}
Expand Down
4 changes: 4 additions & 0 deletions Sources/Flare/Classes/Models/StoreProductDiscount.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ extension StoreProductDiscount: IStoreProductDiscount {
discount.price
}

public var localizedPriceString: String? {
discount.localizedPriceString
}

public var paymentMode: PaymentMode {
discount.paymentMode
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Flare
// Copyright © 2024 Space Code. All rights reserved.
// Copyright © 2023 Space Code. All rights reserved.
//

import Concurrency
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Flare
// Copyright © 2024 Space Code. All rights reserved.
// Copyright © 2023 Space Code. All rights reserved.
//

import StoreKit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Flare
// Copyright © 2024 Space Code. All rights reserved.
// Copyright © 2023 Space Code. All rights reserved.
//

import Atomic
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Flare
// Copyright © 2024 Space Code. All rights reserved.
// Copyright © 2023 Space Code. All rights reserved.
//

import Concurrency
Expand Down
10 changes: 10 additions & 0 deletions Sources/FlareMock/Mocks/ProductMock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ public final class ProductMock: ISKProduct {
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
public var stubbedPrice: Decimal!
Expand Down
2 changes: 1 addition & 1 deletion Tests/FlareTests/UnitTests/FlareTests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Flare
// Copyright © 2024 Space Code. All rights reserved.
// Copyright © 2023 Space Code. All rights reserved.
//

@testable import Flare
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Flare
// Copyright © 2024 Space Code. All rights reserved.
// Copyright © 2023 Space Code. All rights reserved.
//

@testable import Flare
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Flare
// Copyright © 2024 Space Code. All rights reserved.
// Copyright © 2023 Space Code. All rights reserved.
//

import Concurrency
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Flare
// Copyright © 2024 Space Code. All rights reserved.
// Copyright © 2023 Space Code. All rights reserved.
//

@testable import Flare
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Flare
// Copyright © 2023 Space Code. All rights reserved.
// Copyright © 2024 Space Code. All rights reserved.
//

import Foundation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Flare
// Copyright © 2023 Space Code. All rights reserved.
// Copyright © 2024 Space Code. All rights reserved.
//

import XCTest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Flare
// Copyright © 2023 Space Code. All rights reserved.
// Copyright © 2024 Space Code. All rights reserved.
//

@testable import Flare
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Flare
// Copyright © 2023 Space Code. All rights reserved.
// Copyright © 2024 Space Code. All rights reserved.
//

import XCTest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Flare
// Copyright © 2024 Space Code. All rights reserved.
// Copyright © 2023 Space Code. All rights reserved.
//

@testable import Flare
Expand Down
Original file line number Diff line number Diff line change
@@ -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
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Flare
// Copyright © 2024 Space Code. All rights reserved.
// Copyright © 2023 Space Code. All rights reserved.
//

import StoreKit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Flare
// Copyright © 2023 Space Code. All rights reserved.
// Copyright © 2024 Space Code. All rights reserved.
//

@testable import Flare
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Flare
// Copyright © 2023 Space Code. All rights reserved.
// Copyright © 2024 Space Code. All rights reserved.
//

@testable import Flare
Expand Down
Loading

0 comments on commit 357425f

Please sign in to comment.