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

Commit bae9fe4

Browse files
committed
feat: add external purchase API Objective-C bridge methods
1 parent f6171d4 commit bae9fe4

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

Sources/OpenIapModule+ObjC.swift

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,44 @@ import StoreKit
488488
}
489489
}
490490

491+
@available(iOS 16.0, macOS 14.0, *)
492+
@objc func presentExternalPurchaseLinkIOSWithUrl(_ url: String, completion: @escaping (Any?, Error?) -> Void) {
493+
Task {
494+
do {
495+
let result = try await presentExternalPurchaseLinkIOS(url)
496+
let dictionary = OpenIapSerialization.encode(result)
497+
completion(dictionary, nil)
498+
} catch {
499+
completion(nil, error)
500+
}
501+
}
502+
}
503+
504+
@available(iOS 17.4, macOS 14.4, *)
505+
@objc func presentExternalPurchaseNoticeSheetIOSWithCompletion(_ completion: @escaping (Any?, Error?) -> Void) {
506+
Task {
507+
do {
508+
let result = try await presentExternalPurchaseNoticeSheetIOS()
509+
let dictionary = OpenIapSerialization.encode(result)
510+
completion(dictionary, nil)
511+
} catch {
512+
completion(nil, error)
513+
}
514+
}
515+
}
516+
517+
@available(iOS 17.4, macOS 14.4, *)
518+
@objc func canPresentExternalPurchaseNoticeIOSWithCompletion(_ completion: @escaping (Bool, Error?) -> Void) {
519+
Task {
520+
do {
521+
let canPresent = try await canPresentExternalPurchaseNoticeIOS()
522+
completion(canPresent, nil)
523+
} catch {
524+
completion(false, error)
525+
}
526+
}
527+
}
528+
491529
// MARK: - Event Listeners
492530

493531
@objc func addPurchaseUpdatedListener(_ callback: @escaping (NSDictionary) -> Void) -> NSObject {

0 commit comments

Comments
 (0)