问题描述
以下摘录来自Apple文档如何在iOS 7中恢复应用程序。他们说您可以存储收据并稍后查找用户已购买的内容,或者您可以刷新应用程序收据。我的问题是:
The following extract is from the Apple documents how to restore in App purchases in iOS 7. They say that you can store the receipts and find out later what they user already bought or you can refresh the App Receipt. My questions are:
1)是否有一个应用收据或有多个单一收据?
1) Is there the one app receipt or are there many single receipt?
2 )存储这些收据更有意义而不是直接存储用户已购买的功能
2) Does it make more sense to store these receipts instead of just storing directly which features the user has already bought
3)我如何检查从中获得的收据刷新?到目前为止,我所有尝试解析它都失败了。
3) How can I examine the receipt that I get from that refresh? All my tries to parse it failed so far.
4)是否有任何框架具有很多功能(在iCloud上保存收据/购买的产品,使购买更容易,处理下载,处理各种连接问题等)已经?甚至可能支持远程服务器(和验证)。
4) Is there any framework that has a lot of features (saving receipts / bought products on iCloud, making purchases easier, handling downloads, handling all kinds of connection problems, etc.) already? Maybe even with remote server support (and validation).
我希望有人可以提供帮助! :)
I hope somebody can help! :)
刷新应用程序收据
创建收据刷新请求,设置委托,并启动请求。该请求支持在测试期间获取各种状态的收据的可选属性,例如过期收据 - 有关详细信息,请参阅SKReceiptRefreshRequest的initWithReceiptProperties:方法的值。
Create a receipt refresh request, set a delegate, and start the request. The request supports optional properties for obtaining receipts in various states during testing such as expired receipts—for details, see the values for the initWithReceiptProperties: method of SKReceiptRefreshRequest.
request = [[SKReceiptRefreshRequest alloc] init];
request.delegate = self;
[request start];
刷新收据后,检查并交付任何已添加的产品。
After the receipt is refreshed, examine it and deliver any products that were added.
推荐答案
只有一个应用收据。在此之前,Apple为每笔交易提供了收据。这些收据仍然存在但已被弃用。
There is a single app receipt. Before that, Apple provided receipts for each transaction. Those receipts still exist but are deprecated.
不再适用(适用于iOS 7应用)。
Not anymore (for iOS 7 apps).
这是一个复杂的问题。我建议阅读这个毫无歉意的长答案:。
This is a complex issue. I suggest reading this unapologetically long answer: https://stackoverflow.com/a/20039394/143378.
我知道有3个:
- CargoBay
- RMStore
- MKStoreKit
迄今为止,MKStoreKit似乎已被废弃,而CargoBay不支持应用收据。 CargoBay具有RMStore没有的功能,反之亦然。我会检查它们并查看哪一个更符合您的要求。
To date, MKStoreKit appears abandoned and CargoBay doesn't support app receipts. CargoBay has features that RMStore hasn't, and viceversa. I'd check them both and see which one fits your requirements better.
无论如何,我建议您阅读 StoreKit
使用任何库之前的文档。这些库提供代码,而不是理解。
In any case, I recommend reading the StoreKit
documentation before using any libraries. The libraries provide code, not understanding.
免责声明:我开发了RMStore。
Disclaimer: I developed RMStore.
这篇关于iOS应用程序中的恢复购买收据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!