KMDMGPurchaseManager.swift 961 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // KMDMGPurchaseManager.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by lizhe on 2023/6/8.
  6. //
  7. import Cocoa
  8. class KMDMGPurchaseManager: NSObject {
  9. public static let manager = KMDMGPurchaseManager()
  10. var fetchProductCompletion: KMPurchaseFetchProductCompletion?
  11. var availableProducts: [KMProduct] = []
  12. var state: KMPurchaseManagerState {
  13. get {
  14. return self.updatePurchaseState()
  15. }
  16. }
  17. func updatePurchaseState() -> KMPurchaseManagerState {
  18. var tempState: KMPurchaseManagerState = .unknow
  19. return tempState
  20. }
  21. func purchaseProduct(productIdentifier: String, email: String, completion: KMPurchaseCompletion) {
  22. completion(false, .success)
  23. }
  24. func fetchProducts(completion: @escaping KMPurchaseFetchProductCompletion) {
  25. self.fetchProductCompletion = completion
  26. }
  27. func restorePurchases() {
  28. }
  29. }