ios - 检查用户在应用内购买中购买的产品

标签 ios objective-c iphone in-app-purchase

我用过this教程并想知道如何检查其中用户刚刚购买的产品。我在教程的最后看到:

The resources zip for this tutorial contain images for all of the the comics, so if you’re so inclined you can wrap it up by showing the comic in a new view controller when a purchased row is tapped! If you want to do this, you can just check if the productIdentifier is in the purchasedProducts array of the InAppRageIAPHelper before allowing the user access to the content.



但是我测试了但没有成功。一世
想知道你是否知道该怎么做。谢谢你的时间!

最佳答案

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

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

然后,您可以检查应用程序何时启动已购买了哪些标识符
[[NSUserDefaults standardUserDefaults] boolForKey:@"YourIdentifier"];

关于ios - 检查用户在应用内购买中购买的产品,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18035040/

相关文章:

iOS 使用 Segue 导航到表格单元格上的新 View 单击

ios - 无法为通用应用程序设置启动图像

iphone - 如何分别获取id和message的值

iphone - 检查应用程序文件夹中是否存在文件

当使用 Xcode 7 构建+提交时,仅在运行 iOS 8 的 iPhone 4s 上,iOS Testflight 应用程序在启动屏幕上崩溃

iphone - 启动电话应用程序以调用没有号码的电话

ios - Expo - 实现通知设置应用程序图标角标(Badge)编号

objective-c - 我的 PBKDF2 实现不断得到错误的值

ios - 我可以使用另一个 POD 创建自己的 POD 吗?

ios - 无法从 Firebase 缩短的动态链接 URL 检索动态链接