Skip to content
This repository was archived by the owner on Oct 16, 2025. It is now read-only.

Commit fa43cd2

Browse files
committed
chore: handle deprecated storefrontCountryCode
1 parent 911a511 commit fa43cd2

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

Sources/Helpers/StoreKitTypesBridge.swift

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,13 @@ enum StoreKitTypesBridge {
8787
return PurchaseIOS(
8888
appAccountToken: transaction.appAccountToken?.uuidString,
8989
appBundleIdIOS: transaction.appBundleID,
90-
countryCodeIOS: transaction.storefrontCountryCode,
90+
countryCodeIOS: {
91+
if #available(iOS 17.0, *) {
92+
transaction.storefront.countryCode
93+
} else {
94+
transaction.storefrontCountryCode
95+
}
96+
}(),
9197
currencyCodeIOS: nil,
9298
currencySymbolIOS: nil,
9399
environmentIOS: environment,
@@ -110,7 +116,13 @@ enum StoreKitTypesBridge {
110116
reasonStringRepresentationIOS: transaction.reasonDescription,
111117
revocationDateIOS: revocationDate,
112118
revocationReasonIOS: transaction.revocationReason?.rawValue.description,
113-
storefrontCountryCodeIOS: transaction.storefrontCountryCode,
119+
storefrontCountryCodeIOS: {
120+
if #available(iOS 17.0, *) {
121+
transaction.storefront.countryCode
122+
} else {
123+
transaction.storefrontCountryCode
124+
}
125+
}(),
114126
subscriptionGroupIdIOS: transaction.subscriptionGroupID,
115127
transactionDate: transaction.purchaseDate.milliseconds,
116128
transactionId: transactionId,

0 commit comments

Comments
 (0)