Skip to content

Commit

Permalink
fix(ios): omit confirmIn arg
Browse files Browse the repository at this point in the history
  • Loading branch information
hyochan committed Sep 21, 2024
1 parent 1a365d1 commit 01d5536
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"typescriptreact"
],
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.fixAll.eslint": "explicit"
},
"[javascript]": {
Expand Down
9 changes: 8 additions & 1 deletion ios/ExpoIapModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,18 @@ public class ExpoIapModule: Module {
throw NSError(domain: "ExpoIapModule", code: 2, userInfo: [NSLocalizedDescriptionKey: "Could not find window scene"])
}
let result: Product.PurchaseResult
if #available(iOS 17.0, *) {
#if swift(>=5.9)
if #available(iOS 17.0, tvOS 17.0, *) {
result = try await product.purchase(confirmIn: windowScene, options: options)
} else {
#if !os(visionOS)
result = try await product.purchase(options: options)
#endif
}
#elseif !os(visionOS)
result = try await product.purchase(options: options)
#endif

switch result {
case .success(let verification):
let transaction = try self.checkVerified(verification)
Expand Down

0 comments on commit 01d5536

Please sign in to comment.