Google Play Developer API: “startTimeMillis” is updated when it should not

核能气质少年 提交于 2019-12-01 00:26:03

问题


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.

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
}

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.

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?

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.

Thank you


回答1:


Had similar issue and found that:

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

  2. 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



来源:https://stackoverflow.com/questions/27425012/google-play-developer-api-starttimemillis-is-updated-when-it-should-not

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!