在不应该更新时更新

在不应该更新时更新

本文介绍了Google Play开发者API:"startTimeMillis"在不应该更新时更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发带有应用程序内订阅的应用程序.在我们的服务器上,我通过 Google Play开发者API 检查每个订阅的有效性.

I am developing an application with in-app subscriptions. On our servers, I check the validity of each subscription through the Google Play Developer API.

如文档中所述,对Purchases.subscriptions端点的请求将返回如下内容:

As stated in the docs, a request to the Purchases.subscriptions endpoint, returns something like that:

{
  "kind": "androidpublisher#subscriptionPurchase",
  "startTimeMillis": long,
  "expiryTimeMillis": long,
  "autoRenewing": boolean
}

但是,我发现它有一些奇怪的行为.当用户通过Google Play应用取消订阅时,"startTimeMillis"字段更新为取消时间.

However, I am finding some strange behavior with it. When a user cancels a subscription through Google Play app, the "startTimeMillis" field is updated to the time of cancellation.

根据文档,"startTimeMillis"是授予订阅的时间",因此我希望该值不应更改.有人能解释一下为什么取消后会更新吗?

According to the documentation, "startTimeMillis" is "Time at which the subscription was granted", so I expected that this value should not change. Could anybody explain me why it is updated after a cancellation?

我还有一个尚无法测试的重要问题...花了几个月时间处理订阅的人可以告诉我,如果自动续订订阅时,"startTimeMillis" 是否也已更新强>?我也希望这不会改变,但是...现在,我对此不确定.

I have another important question that I can not test yet... Could someone, who has spent several months working with subscriptions, tell me if this "startTimeMillis" is updated too when the subscription is automatically renewed? I expect too that this should not change but... now, I am not sure about this.

谢谢

推荐答案

存在类似问题,并发现:

Had similar issue and found that:

  1. 当用户取消订阅时,startTimeMillis不会更改,只有autoRenewing更改为false

  1. When user cancels the subscription, startTimeMillis won't be changed, only autoRenewing changed to false

如果用户在取消后再次订阅,则google会向您发送一个新的订阅令牌,但是当使用前一个令牌进行查询时,响应将更改为与新令牌相同,即startTimeMillis将更改

If the user subscribes again after the cancelation, google will send you a new subscription token, but when querying with the previous token, the response would be changed to the same as the new token, i.e. startTimeMillis would be changed

这篇关于Google Play开发者API:"startTimeMillis"在不应该更新时更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 12:48