检查用户在应用内购买中购买的产品 [英] Check which product the user bought on an In-App Purchase

查看:82
本文介绍了检查用户在应用内购买中购买的产品的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了这个教程并想知道如何检查用户刚购买的产品。我在本教程的最后看到:

I have used this tutorial and wonder how to check which of the products the user just bought. I saw in the end of the tutorial:


本教程的资源zip包含所有
漫画的图像,因此,如果你是如此倾向,你可以通过在一个新的视图控制器中显示
漫画时将其包装起来! 如果
想要这样做,您可以在允许
用户访问内容之前检查productIdentifier是否在InAppRageIAPHelper的
purchaseProducts数组中。

但是我测试但是没有成功。我想知道你是否知道如何做到这一点。感谢您的时间!

But I tested but it wasn't a success. I wonder if you know how to do it. Thanks for your time!

推荐答案

一种方法是使用NSUserDefaults存储购买的标识符。

One way could be to store purchased identifiers with NSUserDefaults.

[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"YourIdentifier"];
 [[NSUserDefaults standardUserDefaults] synchronize];

然后,您可以检查应用程序何时开始购买了哪些标识符

You can then check when the app starts which identifiers has been bought

[[NSUserDefaults standardUserDefaults] boolForKey:@"YourIdentifier"];

这篇关于检查用户在应用内购买中购买的产品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆