如何使用Parse恢复应用内购买?

时间:2015-09-17 14:07:47

标签: swift parse-platform in-app-purchase

我想创建一个“Restore in-App”按钮,因为Apple需要它。我正在使用Parse作为我的iAP产品,我使用此代码来执行此操作:

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,所以我问你。

1 个答案:

答案 0 :(得分:0)

使用PFPurchase.restore()使用Parse恢复购买。我不确定为什么他们在他们的文档中没有这个。