简体   繁体   English

如何批量验证IOS应用内购买收据?

[英]How do I verify IOS In-App Purchasing Receipts in Bulk?

I'm working on an iOS app that will use Apple's in-app purchasing framework to let the user create auto-renewing subscriptions. 我正在开发一个iOS应用程序,该应用程序将使用Apple的应用程序内购买框架让用户创建自动续订的订阅。

I want my server to check periodically that none of the subscriptions have expired. 我希望服务器定期检查所有订阅都没有过期。 Apple's Receipt Validation Programming Guide describes a verifyReceipt web service that appears to validate a single receipt. Apple的收据验证编程指南介绍了一个verifyReceipt Web服务,该服务似乎可以验证单个收据。

However, if I want to bulk-verify my entire database every few days, is there a better way to do that than a storm of individual verifyReceipt calls? 但是,如果我想每隔几天对整个数据库进行批量验证,有没有比单独的verifyReceipt调用风暴更好的方法呢?

To my knowledge there's no way to send multiple receipts in one bulk request to validate them in the iTunes servers... You have to send one by one. 据我所知,无法在一个批量请求中发送多个收据以在iTunes服务器中对其进行验证……您必须一张一张地发送。 (Multiple requests)... (多个请求)...

I don't know if how you are planing to solve this is the best approach. 我不知道您打算如何解决这个问题是最好的方法。 Apple has extended documentation on how to handle auto renewal subscriptions, most of the times you check the validity of the subscription in the app itself. Apple扩展了有关如何处理自动续订订阅的文档,大多数情况下,您需要在应用程序本身中检查订阅的有效性。

Check the in-app purchase documentation. 查看应用内购买文档。 It's a very good read if you plan to depend on in-app subscriptions for your business model: https://developer.apple.com/library/ios/technotes/tn2259/_index.html 如果您打算依靠应用程序内订阅来实现您的商业模式,那将是一本很好的书: https : //developer.apple.com/library/ios/technotes/tn2259/_index.html

You don't need to need to bulk-verify your entire database. 您无需批量验证整个数据库。 A subscription is valid for a fixed duration. 订阅在固定期限内有效。 If the user cancels their subscription then this takes effect at the next renewal period, not immediately. 如果用户取消其订阅,则该订阅将在下一个续订期内生效,而不是立即生效。

Apple customer service can refund a subscription if a user has a case (wrong product purchase is one example they give) but this would be a pretty low figure - and your app should also check for a valid subscription when it starts. 如果用户有案例(他们提供的产品购买错误是一个例子),Apple客户服务可以退还订阅,但是这个数字非常低-您的应用在启动时还应该检查有效的订阅。

So you should only need to verify subscriptions that are known to be expiring "today". 因此,您只需要验证已知将在“今天”到期的订阅。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM