在应用程序购买获得收据并保存

时间:2014-10-06 05:00:15

标签: ios ios6 in-app-purchase subscription receipt-validation

我的应用有自动续订订阅的服务器端收据验证 特别是在每次重启时,应用程序都需要检查收据是否仍然有效 在iOS7上看起来很简单,只需要那些代码就可以获得收据:

// Load the receipt from the app bundle.
NSURL *receiptURL = [[NSBundle mainBundle] appStoreReceiptURL];
NSData *receipt = [NSData dataWithContentsOfURL:receiptURL];
if (!receipt) { /* No local receipt -- handle the error. */ }

/* ... Send the receipt data to your server ... */

对于iOS6,它似乎回退到transactionReceipt。为了得到2个选项:

  • 购买后保存
  • 再次要求恢复购买

以下是问题,在第一种情况下,我猜收据只对订阅期有效,哪个是保存的正确位置?
在第二种情况下,恢复购买将触发App Store弹出消息,在每次启动时都很无聊 有人可以在正确的道路上让我高兴吗?

0 个答案:

没有答案