Subscription Expiration Date

I have an Android app with app subscriptions. After the user has purchased the subscription, I request "validUntilTimestampMsec" and "initiationTimestampMsec" through our Google API server.

The returned timestamp "initiationTimestamp" is correct and represents the time the user made the purchase, but the returned timestamp "validUntilTimestamp" always has a difference of +12 hours to the actual valid - to the time I need. The i function used to retrieve the date is comparable to both timestamps.

Where did 12 hours come from and how can I get the right time. The expiration date will also not display correctly for a user on Google Play.

Example monthly subscription:

There is:
InitiationTimestamp: 1374433559436 (19:05)
validUntilTimestamp: 1377155159436 (7:05) → start time + 1 month + 12 hours

It is required:
InitiationTimestamp: 1374433559436 (19:05)
validUntilTimestamp: 1377111959 (7:05 pm) → start time + 1 month without 12 hours

+3
source share
2 answers

I do not see this anywhere, but I think that Google supports 6 hours in v1 from the Shrinath example and 12 hours in v1_1 (it seems from your example) to basically save a time buffer for withdrawing funds from the client account (a really important transaction Google is responsible for), as well as for cancellations and repeated requests. I see no way around this, except to show a warning that it may take up to 12 hours to see new material or something like that.

+2
source

Write a function that calculates the action time that is "correct." If Google’s answer does not match, use the one you calculated, otherwise use the one that Google gave.

Also note that Google always adds extra time, not another way. Therefore, if your function returns "more than", Google takes into account the time of Google, otherwise your working time.

This is how I solved it in the backend of the application.

+1
source

All Articles