新增恢复购买

This commit is contained in:
2025-12-16 16:25:50 +08:00
parent e8a980ff5b
commit 6800864866
8 changed files with 81 additions and 1 deletions

View File

@@ -67,6 +67,21 @@ final class KBStoreKitBridge: NSObject, StoreKitDelegate {
}
}
func restorePurchases(completion: @escaping (Bool, String?) -> Void) {
Task {
do {
try await self.manager.restorePurchases()
await MainActor.run {
completion(true, nil)
}
} catch {
await MainActor.run {
completion(false, error.localizedDescription)
}
}
}
}
// MARK: - Private Helpers
@MainActor