以下摘自 Apple 文档如何在 iOS 7 中恢复 App 购买。他们说您可以存储收据并稍后查找他们用户已经购买的内容,或者您可以刷新 App Receipt。我的问题是:
1)是单张收据还是多张收据?
2) 存储这些收据而不是直接存储用户已经购买了哪些功能更有意义吗
3) 我如何检查从刷新中获得的收据?到目前为止,我所有解析它的尝试都失败了。
4) 是否有任何框架已经具备很多功能(在 iCloud 上保存收据/购买的产品、使购买更容易、处理下载、处理各种连接问题等)?甚至可能有远程服务器支持(和验证)。
希望有人能帮帮我! :)
刷新应用收据
创建收据刷新请求,设置委托(delegate),并启动请求。该请求支持可选属性,用于在测试期间获取各种状态的收据,例如过期收据——有关详细信息,请参阅 initWithReceiptProperties: SKReceiptRefreshRequest 方法的值。
request = [[SKReceiptRefreshRequest alloc] init];
request.delegate = self;
[request start];
刷新收据后,检查它并交付添加的任何产品。
最佳答案
1) Is there the one app receipt or are there many single receipt?
有一个应用收据。在此之前,Apple 会为每笔交易提供收据。这些收据仍然存在,但已弃用。
2) Does it make more sense to store these receipts instead of just storing directly which features the user has already bought
不再适用(适用于 iOS 7 应用程序)。
3) How can I examine the receipt that I get from that refresh? All my tries to parse it failed so far.
这是一个复杂的问题。我建议阅读这个毫无歉意的长答案:https://stackoverflow.com/a/20039394/143378 .
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).
我知道有 3 个:
迄今为止,MKStoreKit 似乎已被废弃,CargoBay 不支持应用收据。 CargoBay 具有 RMStore 所没有的功能,反之亦然。我会同时检查它们,看看哪一个更符合您的要求。
无论如何,我建议在使用任何库之前阅读 StoreKit
文档。库提供代码,而不是理解。
免责声明:我开发了 RMStore。
关于带收据的 App 购买中的 iOS 还原,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21566425/