I ran into one problem on Android InApp billing v3. I created the inapp managed product in the playstore and I need to buy it several times from multiple devices. To do this, I am testing the application on two different devices. I do not store purchase data on the local server. Therefore, whenever I need to buy this item again, I will ask for the item to get the purchase status, and based on this, if I buy the purchased product, I will call the purchase function again. I describe my error scenario in detail below
- On the first devices , I did with payment, and I got the result of success.
- On the same device, if I ask for the purchase details, it will give accurate information.
- At the same time, if I request on the second device . it gives
inventory.hasPurchase(sku) as false and inventory.getPurchase(sku) as null .
While googling, I found that it was related to the Google cache file and all. After clearing the cache manually, I get the result as expected. Can anyone advise me on the above issue.
IabHelper.QueryInventoryFinishedListener mGotInventoryListener = new IabHelper.QueryInventoryFinishedListener() { public void onQueryInventoryFinished(IabResult result, Inventory inventory) { if (result.isFailure()) { invokePurchaseError(ResponseCode.FAILED_TO_QUERY_INVENTORY, result.toString()); } else{ if(mActionCode == RC_REQUEST_FOR_QUERYING){ boolean mIsPurchased = false; Log.e("hasPurchase", inventory.hasPurchase(mSku)+""); Log.e("getPurchase", inventory.getPurchase(mSku)+""); if( inventory.hasPurchase(mSku)){ mPurchaseStatus = inventory.getPurchase(mSku); mIsPurchased = (mPurchaseStatus != null && verifyDeveloperPayload(mPurchaseStatus)); if(mPurchaseStatus!=null){ mPurchaseStatus.getOriginalJson()); } else{
source share