简体   繁体   English

iPhone +应用内购买+确定是否购买了产品

[英]iPhone + In App purchase + determine whether product is purchased or not

I am implementing In App purchase in my application. 我正在应用程序中实现应用内购买。

What I want to do is that I have few features that are locked and once user click that feature it will ask to buy that product and once they buy, the feature will be unlocked. 我想做的是,我锁定的功能很少,一旦用户单击该功能,它将要求购买该产品,一旦他们购买,该功能将被解锁。 But before that I have to check whether that particular product is already purchased by the user or not. 但是在此之前,我必须检查用户是否已经购买了该特定产品。 If its already purchased I don't want to show the alert for buying that product. 如果已经购买,我不想显示购买该产品的警报。

How to achieve this. 如何实现这一目标。

Ideally you should save the information about what has been purchased when it is purchased, so you can just check it yourself. 理想情况下,您应该保存有关购买商品的信息,以便您自己检查即可。 In the event of an application reinstall it is possible to query the app store to see all your past transactions. 在重新安装应用程序的情况下,可以查询应用程序商店以查看您过去的所有交易。

If you want to get a list of previous transactions from the store you use -[SKPaymentQueue restoreCompletedTransactions] . 如果要从商店中获取先前交易的列表,请使用-[SKPaymentQueue restoreCompletedTransactions] The restored transactions can be verified just like normal transactions. 可以像正常事务一样验证已还原的事务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM