Skip to content

Commit

Permalink
Fix build issue in new purchases code when targeting visionOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeehut committed Jun 4, 2024
1 parent 097d1ea commit 6fa8028
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,15 @@ extension TelemetryDeck {
priceValueInUSD = 0
}

#if os(visionOS)
let countryCode = "US" // NOTE: visionOS 1.x does not support the `storefrontCountryCode` field
#else
let countryCode = transaction.storefrontCountryCode
#endif

var purchaseParameters: [String: String] = [
"TelemetryDeck.Purchase.type": transaction.subscriptionGroupID != nil ? "subscription" : "one-time-purchase",
"TelemetryDeck.Purchase.countryCode": transaction.storefrontCountryCode,
"TelemetryDeck.Purchase.countryCode": countryCode,
]

if let currencyCode = transaction.currencyCode {
Expand Down

0 comments on commit 6fa8028

Please sign in to comment.