有关应用内购买的问题:自动续订订阅
我的情况是这样的:我有一个免费的应用程序,我计划通过每月 0.99 美元(自动续订)的订阅来提供访问权限。
我仍在沙盒中进行测试,因此我看到自动续订订阅的实际工作方式可能会被扭曲。我的问题如下:
1)可以支持自动续订订阅的最低 iOS 版本是多少?早期 iOS 版本的用户将如何体验上述功能?
2)如果我理解正确的话,自动续订订阅被归类为“非消耗”项目,只能购买一次。当我尝试在到期日(或续订开始日期)之前重新购买订阅时会发生什么:我不会再次被收取费用,不是吗?
3) 如果订阅自动续订,我的应用程序会收到通知吗?我想象应用程序将自动发送 paymentQueue:updatedTransactions: 在我的 SKPaymentTransactionObserver 中的方法调用,但我在沙箱中工作时从未见过这种情况发生。就我而言,我必须在启动期间针对购买收据的到期日期运行本地时间戳检查。
4) 如果我必须使用我从初始购买(或连续续订)中保存的收据与 iTunes 服务器进行通信,我如何正确检查 iTunes 订阅是否仍然有效或者用户是否已禁用自动订阅续约?
5) 我的应用内购买项目是订阅本身,应用程序知道其产品代码...当您已经知道它是什么时,真的有必要检索产品详细信息吗?苹果的 IAP 指南似乎很清楚地表明我需要这样做,但这对我来说似乎只是开销。
Here’s my situation: I have a free app which I plan to provide access to through a $0.99 monthly (auto-renewable) subscription.
I am still testing in the sandbox, so the way I see how auto-renewable subscriptions really work may be distorted. My questions below are as follows:
1) What is the minimum version of iOS that can support auto-renewable subscriptions? How will users of earlier iOS versions experience said functionality?
2) If I understood it correctly auto-renewable subscriptions are classified as “non-consumable” items, that can be bought only once. What happens when I try to re-purchase a subscription before its expiry date (or the date where renewal is set to kick in): I won’t get charged again, will I?
3) Will my app get notified if the subscription auto-renews? I would imagine that the app will automatically be sent a paymentQueue:updatedTransactions: method call in my SKPaymentTransactionObserver but I’ve never been able to see this happen while working in the sandbox. In my case I have to run a local timestamp check against the purchase receipt’s expiry date during startup.
4) If I have to communicate with the iTunes server, using the receipt I saved from the initial purchase (or from successive renewals), how do I properly check with iTunes if a subscription is still active or if the user has already disabled auto-renewal?
5) My in-app purchase item is the subscription itself, whose product code is known to the app... Is it really necessary to retrieve the product details when you already know what it is? Apple’s IAP Guide seems to makes it pretty clear that I need to do this but it seems just overhead for me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你尝试过我的 MKStoreKit 吗?
http://blog.mugunthkumar.com/coding/mkstorekit-4-0 -supporting-auto-renewable-subscriptions/
第 1 点:不确定这一点,但我最好的猜测是 iOS 4.3。
第2点:当您重新购买时,AppStore会发送一条消息,表明您已经订阅了该产品。从技术上讲,您不应该显示允许用户订阅的按钮(订阅处于活动状态时禁用它,MKStoreKit 提供通知来执行此操作)
第 3 点:是的,您的应用程序将收到通知。 MKStoreKit 使用此通知并自动为您存储最新的收据
第 4 点:在启动时,您应该发布从 iTunes 服务器获得的最后收据并检查它是否仍然有效。 AppStore 会向您返回最新收据的购买日期。由此您必须计算收据的有效性(因为您知道订阅的长度。请注意,iTunes App Store 服务器不会向您发送有关订阅长度的任何信息)
第 5 点:应获取所有产品详细信息当应用程序启动时。否则,当客户进行购买并在完成之前退出应用程序(由于电话)时,您将无法在应用程序恢复时知道他购买了哪些产品。延迟加载对于应用内购买来说并没有什么意义。
Did you try with my MKStoreKit?
http://blog.mugunthkumar.com/coding/mkstorekit-4-0-supporting-auto-renewable-subscriptions/
Point 1: Not sure of this, but my best guess is iOS 4.3.
Point 2: When you re-purchase, AppStore sends a message that you are already subscribed to this product. Technically you shouldn't show the button that allows the user to subscribe (Disable it when subscription is active, MKStoreKit provides Notifications to do this)
Point 3: Yes your app will be notified. MKStoreKit consumes this notification and automatically stores the latest receipt for you
Point 4: At launch you should post the last receipt you got from iTunes server and check if it's still valid. AppStore returns you the purchase date of the latest receipt. From this you have to calculate the validity of the receipt (since you know the length of the subscription. Note that iTunes App Store server doesn't send you any info about the length of the subscription)
Point 5: All product details should be fetched when app is launched. Otherwise when a customer makes a purchase and before completion he quits the app (due to a phone call) you will not be able to know which product he bought when your app resumes. Delay loading doesn't really makes sense with In-App purchases.