1

我的应用程序具有自动续订订阅的服务器端收据验证。
特别是在每次重新启动时,应用程序需要检查收据是否仍然有效。
在 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 弹出消息,在每次启动时询问它非常无聊。
有人可以启发我走上正确的道路吗?

4

0 回答 0