瀏覽代碼

Update `verifyReceipt` usage in macOS example code

Andrea Bizzotto 8 年之前
父節點
當前提交
e316d3f833
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      SwiftyStoreKit-macOS-Demo/ViewController.swift

+ 4 - 2
SwiftyStoreKit-macOS-Demo/ViewController.swift

@@ -105,7 +105,8 @@ class ViewController: NSViewController {
 
 
     @IBAction func verifyReceipt(_ sender: AnyObject?) {
     @IBAction func verifyReceipt(_ sender: AnyObject?) {
 
 
-        SwiftyStoreKit.verifyReceipt(password: "your-shared-secret") { result in
+        let appleValidator = AppleReceiptValidator(service: .production)
+        SwiftyStoreKit.verifyReceipt(using: appleValidator, password: "your-shared-secret") { result in
 
 
             self.showAlert(self.alertForVerifyReceipt(result)) { response in
             self.showAlert(self.alertForVerifyReceipt(result)) { response in
 
 
@@ -116,7 +117,8 @@ class ViewController: NSViewController {
 
 
     func verifyPurchase(_ purchase: RegisteredPurchase) {
     func verifyPurchase(_ purchase: RegisteredPurchase) {
         
         
-        SwiftyStoreKit.verifyReceipt(password: "your-shared-secret") { result in
+        let appleValidator = AppleReceiptValidator(service: .production)
+        SwiftyStoreKit.verifyReceipt(using: appleValidator, password: "your-shared-secret") { result in
             
             
             switch result {
             switch result {
             case .success(let receipt):
             case .success(let receipt):