检查自动续订订阅是否仍然有效 [英] Check if an Auto-Renewable Subscription is still valid

查看:717
本文介绍了检查自动续订订阅是否仍然有效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我打开应用程序时,我都想查看自动续订订阅状态。

I would like to check the Auto Renewable Subscription status whenever I open the app.

这是为了确保用户仍然订阅了该服务。我如何实现这一目标?

This is to make sure that the user is still subscribed to the service. How do I achieve this?

有什么想法吗?谢谢

PS:我正在使用 SwiftyStoreKit

推荐答案

以下是几种进行收据验证以检查用户是否已授予订阅的方法。以下是正确执行此操作的两种方法:

Here is several ways to do receipt validation to check is user granted to subscription. Here is two ways of doing it correctly:


  1. 在本地写入收据验证这里

  2. 在写入时远程执行收据验证这里。提到收据不应该发送到App Store白色应用程序。简短摘要:

  1. Do receipt validation locally as it is written here.
  2. Do receipt validation remotely as it is written here. It is mentioned that receipt should not be sent to App Store white an app. Short summary:


  • 您的应用程序向您的后端发送收据。

  • 您的后端向Apple发送收据后端验证。

  • 您的后端从苹果获得回复。

  • 您的后端将结果发回给您的应用,收据有效或无效。

  • Your app sends receipt to your backend.
  • Your backend sends receipt to Apple backend for validation.
  • Your backend gets response from the apple.
  • Your backend sends result back to your app is receipt valid or invalid.

在这两种方式中,您都会获得应用内购买列表。它也将包含过期的订阅。您需要完成所有订阅并检查到期日期。如果它仍然有效,您必须向用户授予订阅。

In both ways you will get list of in-app purchases. It will contain expired subscriptions as well. You would need to go through all subscriptions and check expiration dates. If it is still valid you must grant user with subscription.

据我所知,你使用的是SwiftyStoreKit,这是本地收据验证

As I understand you are using SwiftyStoreKit and here is open task for local receipt validation.

这篇关于检查自动续订订阅是否仍然有效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆