我想创建一个“恢复应用内”按钮,因为 Apple 需要它。我正在为我的 iAP 产品使用 Parse,并使用以下代码来执行此操作:
PFPurchase.buyProduct("iapbanner", block: { (error:NSError!) -> Void in
if error != nil {
let alert = UIAlertController(title: "Errore", message: error?.localizedDescription, preferredStyle: UIAlertControllerStyle.Alert)
alert.addAction(UIAlertAction(title: "Ok", style: UIAlertActionStyle.Default, handler: nil))
self.presentViewController(alert, animated: true, completion: nil)
} else {
self.opzioniTableView.reloadData()
}
})
这很好用。不过,在 Parse 的文档中没有提到如何恢复你的 iAp,所以我问你。
最佳答案
使用 PFPurchase.restore()
恢复通过 Parse 进行的购买。我不确定为什么他们的文档中没有这个。
关于swift - 如何使用 Parse 恢复应用内购买?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32632428/