Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions ios/HybridRnIap.swift
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,10 @@ class HybridRnIap: HybridRnIapSpec {
products.append(product)
seenIds.insert(product.id)
}
// Capture products as local constant to avoid Swift 6 concurrency warning
let capturedProducts = products
await MainActor.run {
products.forEach { self.productTypeBySku[$0.id] = $0.type.lowercased() }
capturedProducts.forEach { self.productTypeBySku[$0.id] = $0.type.lowercased() }
}
RnIapLog.result(
"fetchProducts", products.map { ["id": $0.id, "type": $0.type] }
Expand Down Expand Up @@ -327,7 +329,7 @@ class HybridRnIap: HybridRnIapSpec {
let sanitizedPayload = RnIapHelper.sanitizeDictionary(purchasePayload)
RnIapLog.payload("finishTransaction.nativePayload", sanitizedPayload)
let purchaseInput = try OpenIapSerialization.purchaseInput(from: purchasePayload)
try await OpenIapModule.shared.finishTransaction(purchase: purchaseInput, isConsumable: nil)
_ = try await OpenIapModule.shared.finishTransaction(purchase: purchaseInput, isConsumable: nil)
RnIapLog.result("finishTransaction", true)
await MainActor.run {
self.purchasePayloadById.removeValue(forKey: iosParams.transactionId)
Expand Down
2 changes: 1 addition & 1 deletion ios/RnIapHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import OpenIAP
/// Similar to Android's OpenIapException, this wraps errors with JSON-serialized messages.
/// Uses NSError for better compatibility with Objective-C bridging in Nitro.
@available(iOS 15.0, *)
class OpenIapException: NSError {
class OpenIapException: NSError, @unchecked Sendable {
static let domain = "com.margelo.nitro.rniap"

convenience init(_ json: String) {
Expand Down