I refer to google sample BillingRepository.kt to implement my BillingRepository; As Google advises that developer should call BillingClient.queryPurchases() at onResume() callback;
So when I purchase an item successfully, I got the following code path:
- onPurchasesUpdated() --> first acknowledgePurchase()
- BillingRepository.queryPurchasesAsync() ---> second acknowledgePurchase()
- The play store purchase flow Activity finished and MyActivity get onResume() callback to invoke BillingRepository.queryPurchasesAsync()
Then I found the wired things:
one of the two acknowledgePurchase() will get a DEVELOPER_ERROR(respond code 5), and the debug message is "Server error! Please try again!";
possible cases:
- 1st acknowledgePurchase() get DEVELOPER_ERROR, 2th acknowledgePurchase() get successfully
- 1st acknowledgePurchase() get successfully, 2th acknowledgePurchase() get DEVELOPER_ERROR [This is the most common case]
- both acknowledgePurchase() get successfully
testing with billing client library version is 3.0.0/2.2.0/2.1.0;
Can anyone explain this? Thanks