更新时间:2022-12-31 13:30:54
您可以通过向Apple的服务器发送收据验证来查找用户订阅的到期日期。请查看 In-App Purchase Programming Guide 。
You can find the expiration date of a user's subscription by sending a receipt verification to Apple's servers. Check out figure 1-3 on the In-App Purchase Programming Guide.
基本上步骤是:
[SKPaymentQueue restoreCompletedTransactions]
。 expires_date
的密钥(表示为自1970年1月1日以来的毫秒秒)。[SKPaymentQueue restoreCompletedTransactions]
.expires_date
(expressed in milli seconds since Jan 1, 1970 GMT).我使用本指南帮助我在服务器端:使用PHP和cURL验证App App Purchase的Apple App Store收据。
I used this guide to help me on the server side: Verifying Apple App Store Receipts For In App Purchases With PHP and cURL.
无法确定用户是否已启用或关闭自动续订。 Apple不允许您访问此信息。唯一的方法是等到有效日期过期而没有续订。
There is no way to determine if the user has auto-renewal turned on or off. Apple doesn't give you access to this information. The only way is to wait until the expiration date passes without a renewal.