Android In-app purchase: While purchasing got network failed popup but purchase has been completed got an email

核能气质少年 提交于 2019-12-22 01:00:40

问题


I am getting a weird issue from the in-app purchase IInAppBillingService version 3 since 1 week ago.

Below are the steps what I had followed:

Note: I followed these steps because few of my users got same network issue but purchase has been completed. But app still showing Buy button for that product. So to replicate the issue I had to follow these steps.

  1. Installed the debuggable signed APK over the play store version.
  2. Clicked on item to buy
  3. Opened the play store popup with Buy button. Clicked on Buy in the purchased popup
  4. I lost the network while purchasing a product. Got a popup with No Internet Connection
  5. Clicked on ok in the No Internet Connection popup. Return to my application.
  6. Again clicked on item to buy.
  7. Now got the Error --> You already owned this item

But the problem is, I didn't get any purchase result in the app mPurchaseFinishedListener callback. I got Null. Even I got the email from the google and I checked that whether it is purchased or not in the Google Play store --> Menu --> Account --> Order History

My product is Managed Product but user can purchased it multiple times. So for that, whenever opening the product or after finishing the purchase consuming the desired purchase based on the skuId if it is purchased.

if (purchase != null && purchase.getItemType().equalsIgnoreCase("inapp"))
{
    mHelper.consumeAsync(purchase, mConsumeFinishedListener); 
}

Now I am not able consume the product or even not able to purchase. Why is it so that play store completed the purchase but it didn't return the purchase details to callback?

As far as I know if an item already purchased for that SKUID it should return the purchase details. But in my case it is not returning the purchase details.

Can any one help me to resolve this issue?


回答1:


Do you get an error code of 2 in the response?

It looks like an issue of Google Play services and the Google Play client app getting out of sync because of no network. When the network is available and the sync happens (in a few hours time), you'll be able to buy the product again.



来源:https://stackoverflow.com/questions/44548649/android-in-app-purchase-while-purchasing-got-network-failed-popup-but-purchase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!