0

This problem occurs to me: Purchase a subscription through a movie with a lock. I click on the camera button. The subscription view opens. I make my purchase: I display an error message (but the purchase is still successful).

func subscribe(sub: SubscriptionType) {
DispatchQueue.main.async { let _ = MBProgressHUD.standardHud(over: self.managedView) }
FS2Recipes.subscribe(sku: sub.sku()).then { _ in
    self.subscribed()
}.catch { error in
    debugPrint("Error \(error.localizedDescription)")
    let alert = UIAlertController(title: "Ooops", message: "There was an error processing your purchase. Try again later!", preferredStyle: UIAlertControllerStyle.alert)
    alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { [weak self] _ in
        self?.dismiss()
    }))
    self.present(alert, animated: true, completion: nil)
}.always {
    DispatchQueue.main.async { let _ = MBProgressHUD.hide(for: self.managedView, animated: true) }
}

}

Error

2
  • What's the error? BTW - just print error, not error.localizedDescription.
    – rmaddy
    Mar 9, 2019 at 23:49
  • the error lies in the fact that even if it comes out that the purchase was not successful, in reality it was successful and the purchases are discharged.
    – user11177600
    Mar 9, 2019 at 23:58

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.