What is the maximum length of Google Play Billing purchase token?
Asked Answered
D

1

12

NOTE: This question is not duplicate of What is maximum purchaseToken length provided by google after in app purchases in android? , because that question and answer is concerning AIDL, which is different from the current google play billing library, and the source of the answer is not valid now.

My question is simply "how long the maximum length of the purchase token introduced in Google Play Billing Library."

The documentation does not provide any information about the length of purchase token, although it needs us to store and replace it if necessary.

Any information would be helpful, thanks!

Decency answered 3/7, 2020 at 3:15 Comment(0)
P
2

We have been working on a v4 system upgrade here and I had the same question setting up the schema for the unique constraint (max length in particular)

Looking at the AIDL data we had the following data shape through 2018 (v3):

Total AIDL Google Purchase Token Count: 476,778

Min Len: 165

Max Len: 187

Avg.Len: 174

While developing for v4 today I snagged some purchase tokens from our license tester purchase activity to do this rather small empirical analysis. Today we had only 15 we could consider and each of those was 144 in length with zero variation. This was a testing license users generating receipt data for us in app using the actual purchase flow (and I suspect that is why they are equal in length.)

the v4 sample: 144 avg/min/max len

The length of the last 15 captured purchase token string lengths

As we get more data (especially from our live early access release coming up) I will endeavor to post more current data (prod me in three months if I don't return. Happy to share findings.) In the AIDL system I had a max text size limit of 400 on the field btw. I think I am just going to keep that and log any occurrence that exceeds that and would require more.

NOTE: I should point out all our data for v4 is consumable, the v3 data was one time entitlements. I don't how much a difference that makes...

NOTE: While working on this v4 system, v5 dropped (2022-05-11)... Looks like its mostly enhancements for subs. I will address those later. We're not enabling subscriptions just yet, but intend too.

edit I initially said v3 everywhere, I meant v4 billing for the new data... our previous system was Billing v3 circa ~2018.

Pinfish answered 29/8, 2022 at 7:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.