此问题发生在我身上:通过带锁的电影购买订阅。我单击相机按钮。订阅视图打开。我进行购买:我显示一条错误消息(但购买仍然成功)。
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) }
}
错误在于,即使证明购买不成功,实际上还是成功,并且购买被撤消。