Google IAP: skusBundle array associated with key ITEM_ID_LIST cannot contain more than 20 items., jsarraycontain
In the past few days, I received the payment from Google and switched the chrysanthemum when I pulled the Google product list. I didn't return it for a long time (querySkuDetails). At first I thought it was caused by incorrect IAP keys, no problem found.
Check logcat again and find this line:
Input Error: skusBundle array associated with key ITEM_ID_LIST cannot contain more than 20 items.
Indeed, there are 23 IAP products and two solutions:
1. https://code.google.com/archive/p/marketbilling/issues/123
The IabHelper patch processes the request in batches. This patch has been generated for a while. I don't know if Google has put this merge in. I want to know more about it.
2. in fact, it is not the second solution. IabHelper is modified from the Google layer because I have encapsulated the Google layer before developing the game and added my own Helper layer, after the jar package is compiled, I am too lazy to try it again. Therefore, the second solution is to batch requests from the business layer.
When the business layer sends batch requests in batches, note that the requests cannot be sent twice or more at the same frame. Otherwise, only the last request data will be returned (test-by-test = ).
My practices (briefly described ):
(1) calculate the total number of batches.
(2) start to request the first batch and wait for the first batch to return
(3) add the first batch of returns to the product list. The current batch number is + 1.
(4) If it is less than the total number of batches, request the next batch. If it is equal to the total number of batches, jump out and do the following...
Set a total chrysanthemum conversion time. If the network is stable, the two batches will be pulled in two or three seconds.