refactor: Show restored product in alert

This commit is contained in:
Andrea Busi
2020-11-29 12:57:07 +01:00
parent 24f63c7d4b
commit f707186dea
@@ -177,8 +177,14 @@ class SubscriptionsViewController: UITableViewController {
if isRestorePurchase {
isRestorePurchase = false
var product: String = "unknown"
if let productIdentifier = notification.object as? String, let productName = resourceNameForProductIdentifier(productIdentifier) {
product = productName
}
let message = "\(NSLocalizedString("purchase_pro_restore_alert_message", comment: ""))\n\n(\(product))"
let alert = UIAlertController(title: NSLocalizedString("purchase_pro_restore_alert_title", comment: ""),
message: NSLocalizedString("purchase_pro_restore_alert_message", comment: ""), preferredStyle: .alert)
message: message, preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))
present(alert, animated: true, completion: nil)
}