关于在应用购买中实施自动续订的疑问

时间:2012-07-21 10:04:27

标签: iphone ios ios4 in-app-purchase

我的应用程序将具有非消耗品和自动续订订阅。我在app中使用非消费品购买个人歌曲。并计划通过订阅销售歌曲(歌曲组)。

我已经在我的应用程序中购买了非消耗品。我的方式如下

1) Stored product identifiers from my web server.

2) fetched and displayed the products.

3) when the user taps "buy" for single song, the payment will be done and i will check the 
transaction receipt with apple server using my webserver.

4) if the receipt status is 0, i will make entry into my webserver database as that particular user has purchased that particular song.( by sending user id and product identifer)

5) then i deliver the content.

这就是我的工作方式。现在我开始实施自动续订订阅。生成共享密钥并存储在iphone应用程序中。

根据文档,在用Apple服务器验证交易收据时,还需要发送共享密码。现在我想知道下面的事情

1) does my non consumable in app purchase makes sense? or am i left anything?

2) for the auto renewable subscription, once the transaction receipt is valid, what are the information i need to store in my web server.i mean, how can i know when the subscription going to expire, expire date, etc ?

3) how to check whether the subscription is valid before delivering the content?

4) if my steps to do are wrong pls suggest me how can i proceed? please share your opinion
sorry to be dumb

1 个答案:

答案 0 :(得分:0)

  1. 是的,我觉得对于非消耗品,这是有道理的。由于您只购买一次,将信息输入您的网络服务器数据库应该没问题。

  2. 交易收据正是您的信息来源:它不是"一旦有效",但要查明订阅是否已过期,您应该存储收据。在您的应用程序的每次启动时(因为这是耗费资源的),您可以再次将收据发送给Apple"以进行验证" - 实际上,这会检查订阅是否仍然具有Appe的活动(即已在适当的时间续订)。从Apple返回的答案包含(在JSON字典中)有关失效日期的信息等(请参阅此处https://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/RenewableSubscriptions/RenewableSubscriptions.html#//apple_ref/doc/uid/TP40008267-CH4-SW2

  3. 然后,您可以在应用程序的某个位置(非永久性地)存储订阅是否有效的信息,以便了解是否在实际运行期间提供内容。