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

Commit 382b66e

Browse files
committed
fix: Use NSDictionary for Objective-C compatibility in event listeners
Changed callback parameter types from [String: Any?] to NSDictionary in addPurchaseUpdatedListener and addPurchaseErrorListener to ensure Objective-C compatibility for Kotlin Multiplatform interop.
1 parent 31149c4 commit 382b66e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Sources/OpenIapModule+ObjC.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,18 +282,18 @@ import StoreKit
282282

283283
// MARK: - Event Listeners
284284

285-
@objc func addPurchaseUpdatedListener(_ callback: @escaping ([String: Any?]) -> Void) -> NSObject {
285+
@objc func addPurchaseUpdatedListener(_ callback: @escaping (NSDictionary) -> Void) -> NSObject {
286286
let subscription = purchaseUpdatedListener { purchase in
287287
let dictionary = OpenIapSerialization.purchase(purchase)
288-
callback(dictionary)
288+
callback(dictionary as NSDictionary)
289289
}
290290
return subscription as! NSObject
291291
}
292292

293-
@objc func addPurchaseErrorListener(_ callback: @escaping ([String: Any?]) -> Void) -> NSObject {
293+
@objc func addPurchaseErrorListener(_ callback: @escaping (NSDictionary) -> Void) -> NSObject {
294294
let subscription = purchaseErrorListener { error in
295295
let dictionary = OpenIapSerialization.encode(error)
296-
callback(dictionary)
296+
callback(dictionary as NSDictionary)
297297
}
298298
return subscription as! NSObject
299299
}

0 commit comments

Comments
 (0)