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

标签 swift parse-platform in-app-purchase

我想创建一个“恢复应用内”按钮,因为 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/

相关文章:

ios - 向 PFUser 的子类添加指针字段

android - 这是放置应用内购买成功通知的正确位置吗?

iphone - 通过 iPhone 应用程序销售现实世界的商品?

ios - 如何在 Swift 中封装 UIViewController(如 UIAlertController)?

ios - 如何最大限度地减少将 html 转换为 NSAttributedString 的时间

swift - "data.map(Result.success)"是如何工作并返回一种类型的 Result<Data, Error> 的?

ios - 将用户输入从文本字段存储到解析数据库

ios - 如何从 Parse 查询中获得超过 1000 个结果?

iphone - 应用商店测试具有应用内购买功能的应用程序

ios - Whatsapp 共享文件