- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在为我的应用(即将发布)实现应用内购买,并提供对 iOS6 和 iOS7 的支持。我的问题与 iOS6 和 iOS7 之间的非续订订阅机制之间的差异有关,更具体地说是关于如何实现还原。为了同时适应 iOS6 和 iOS7,我实现了一个服务器端解决方案来启用恢复。我可以选择允许用户创建一个用户名/密码,该用户名/密码可用于不同的设备(如果数据丢失,则为同一设备)进行恢复。我的大部分内容基本上都在工作,但是随着我的测试不断进步,我发现了一些奇怪的东西。
我的 iOS7 恢复过程的初始部分使用 SKReceiptRefreshRequest 刷新应用程序中的收据。当我从 iOS7 设备上删除应用程序时,重新安装(此时没有收据;使用 iExplorer 测试)并进行恢复,SKReceiptRefreshRequest 恢复 10 个购买(我在测试期间为这个特定用户创建的) .其中之一是非消耗品和 九张收据是不可更新的 .这让我很困惑。从 Apple 文档中,我预计只会在刷新的收据中看到非消耗品购买。来自 https://developer.apple.com/library/ios/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateLocally.html :
“Consumable Products and Non-Renewing Subscriptions: The in-app purchare receipt for a consumable product or a non-renewing subscription is added to the receipt when the purchase is made. It is kept in the receipt until your app finishes that transaction. After that point, it is removed from the receipt the next time the receipt is updated—for example, when the user makes another purchase or if your app explicitly refreshes the receipt.”
Use iCloud or your own server to track purchases and allow user to restore purchased subscriptions to all iOS devices owned by a single user
Question: Why does SKReceiptRefreshRequest leave purchases for non-renewing products in the receipt? Is this a bug in the Apple docs or is there something else going on?
SKReceiptRefreshRequest
进行恢复时(这似乎是 Apple 推荐的恢复方法,请参阅
https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/Restoring.html ),我现在没有在收据中显示非续订订阅购买。我只获得非消耗品(我的应用程序只有非续订订阅和非消耗品购买)。至少在我写完这篇文章后,我将立即向 Apple 提交一份错误报告,他们的文档对预期行为不明确。
最佳答案
请注意,在 App Receipt 中持续非续订订阅不能保证您会被 App Store 审核者接受。成功取决于特定的审阅者。我最近收到了来自 Apple 的这条消息:
We found that your app includes a feature to restore previously purchased In-App Purchase products by entering the user's Apple ID and password. However, Non-Renewing Subscription In-App Purchases cannot be restored in this manner.
It would be appropriate to revise your binary to remove this feature. If you would like users to be able to restore Non-Renewing Subscription In-App Purchase products, you will need to implement your own restore mechanism.
For non-renewing subscriptions, use iCloud or your own server to keep a persistent record. (c) Store Kit Programming Guide
#if USE_ICLOUD_STORAGE
NSUbiquitousKeyValueStore *storage = [NSUbiquitousKeyValueStore defaultStore];
#else
NSUserDefaults *storage = [NSUserDefaults standardUserDefaults];
#endif
NSData *newReceipt = transaction.transactionReceipt;
NSArray *savedReceipts = [storage arrayForKey:@"receipts"];
if (!receipts) {
// Storing the first receipt
[storage setObject:@[newReceipt] forKey:@"receipts"];
} else {
// Adding another receipt
NSArray *updatedReceipts = [savedReceipts arrayByAddingObject:newReceipt];
[storage setObject:updatedReceipts forKey:@"receipts"];
}
[storage synchronize];
关于ios7 - 非续订订阅 : Removed From Receipt?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20913875/
我是一名优秀的程序员,十分优秀!