ios - 取消 Apple 自动续订订阅

标签 ios swift in-app-purchase

也许有人有经验可以告诉我如何检测用户是否取消订阅?

仅供引用:订阅前我没有试用版。

例如,用户安装应用进行订阅,5 个月后决定取消订阅。我怎样才能检测到它?我想知道它,因为根据它我将禁止访问我的应用程序。

谢谢。

最佳答案

如果您的客户购买了 12 个月的订阅并在 5 个月后取消,您必须交付他/她所购买的产品。 在订阅结束之前,您不能禁止访问您的应用。

如果您的客户购买月度订阅,同样适用,但您将在期末验证并允许或不允许访问,但之前绝不会。

来自这份文件: https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/Subscriptions.html

A subscription is paid for in full when it is purchased. Users can receive a refund only by contacting Apple customer service. For example, if the user accidentally buys the wrong product, customer support can cancel the subscription and issue a full or partial refund. Customers may cancel a subscription in the middle of a subscription period, but the subscription remains paid through the end of the same period.

也就是说……

您可以将此信息存储在您的应用中,或进行服务器验证以检查收据中的新数据。

有很多文档和示例,您可以将它们全部混合起来并制定自己的解决方案。

这也许是一个好的开始: https://developer.apple.com/library/content/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html

新的 iTunes 还提供了一个 url 回调字段,它会向您发送一个 json,其中包含您订阅中的所有交易更新。

关于ios - 取消 Apple 自动续订订阅,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45739711/

相关文章:

iOS - 通过系统获取媒体库访问警报的回调

objective-c - 使用核心数据实体作为枚举?

ios - 如何用 objective-c 类做IS?

android - 使用 Android 应用程序进行应用内购买

java - 应用内结算广告移除 : Ads are not showing

ios - 如何访问我的应用程序的派生数据文件夹本身?

ios - 在 Swift 中是否有将 Double 转换为 Float 的正确方法?

swift - 更新栏按钮项目内的日期

iphone in app purchases non renewable product 多次购买

ios - 在 tableView 中添加填充功能 (Swift)