简体   繁体   English

iOS 应用内购买取消是否反映在 NSBundle.mainBundle().appStoreReceiptURL 上

[英]Does iOS In-App-Purchase cancellation reflect on NSBundle.mainBundle().appStoreReceiptURL

Let's say an iOS user purchases an auto renewal subscription.假设 iOS 用户购买了自动续订订阅。 I am aware that NSBundle.mainBundle().appStoreReceiptURL shows some kind of digital receipt I can use to verify the purchase and the continuation of the subscription.我知道NSBundle.mainBundle().appStoreReceiptURL显示了某种数字收据,我可以用它来验证购买和订阅的继续。

Then after some point the user cancels the subscription.然后在某个时间点之后用户取消订阅。

Questions :问题

When user cancels the subscription,当用户取消订阅时,

  1. Does NSBundle.mainBundle().appStoreReceiptURL reflect that cancellation right away? NSBundle.mainBundle().appStoreReceiptURL是否立即反映取消?

I'm skeptical in this regard because NSBundle.mainBundle() is used to pull up what's stored locally in the app.我在这方面持怀疑态度,因为NSBundle.mainBundle()用于提取应用程序本地存储的内容。 If the user cancels the subscription by going to the OS' settings, and that will send some type of notification to Apple Server, then Apple Server should notify the app somehow.如果用户通过转到操作系统的设置取消订阅,并且会向 Apple Server 发送某种类型的通知,那么 Apple Server 应该以某种方式通知应用程序。

  1. If somehow NSBundle.mainBundle().appStoreReceiptURL reflects the cancellation right away.如果以某种方式NSBundle.mainBundle().appStoreReceiptURL反映取消。 How does Apple do it?苹果是如何做到的? Or is it up to me to implement a protocol to get the cancellation info?还是由我来实施一个协议来获取取消信息?

  2. If, in fact, I do need to run a protocol, do other apps run it every time the app is launched?事实上,如果我确实需要运行一个协议,那么每次启动该应用程序时,其他应用程序是否都会运行它?

The user doesn't cancel the subscription as such.用户不会取消订阅。 They turn off the renewal, so the subscription will not renew at the completion of the current period.他们关闭续订,因此订阅不会在当前期间完成时续订。 If the auto renewal was still enabled then a new in-app purchase would be added to the receipt for the next period, but this will now not occur, so your app should determine that there isn't a currently active subscription and remove access to the content/features as appropriate.如果自动续订仍处于启用状态,则新的应用内购买将添加到下一个时期的收据中,但现在不会发生这种情况,因此您的应用应确定当前没有活动订阅并删除对适当的内容/功能。

Apple can cancel a subscription at the request of the user. Apple 可以应用户的要求取消订阅。 In this case the cancellation_date field of the in-app purchase receipt item will have a value and your app should treat it as if the purchase was never made.在这种情况下,应用内购买收据项的cancellation_date字段将具有一个值,您的应用应将其视为从未进行过购买。

Your app should periodically (and at least at every launch) refresh the application receipt and verify the currently active subscriptions.您的应用应定期(至少在每次启动时)刷新应用收据并验证当前活动的订阅。

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

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