Skip to content

Commit

Permalink
Build fix
Browse files Browse the repository at this point in the history
  • Loading branch information
NachoSoto committed May 16, 2023
1 parent 58f7e0b commit 39d2666
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Sources/Purchasing/StoreKitAbstractions/SK2StoreProduct.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,14 @@ private extension SK2StoreProduct {

var _currencyCode: String? {
#if swift(>=5.7)
if #available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *) {
return self.currencyCodeFromPriceFormat
}
#endif

return self.currencyCodeFromPriceFormat
#else
// note: if we ever need more information from the jsonRepresentation object, we
// should use Codable or another decoding method to clean up this code.
let attributes = jsonDict["attributes"] as? [String: Any]
let offers = attributes?["offers"] as? [[String: Any]]
return offers?.first?["currencyCode"] as? String
#endif
}

private var jsonDict: [String: Any] {
Expand Down

0 comments on commit 39d2666

Please sign in to comment.