refactor: Show restored product in alert
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user