eggheadgames / android-in-app-payments

Support Android Google Play and Amazon in-app billing (IAP) payments with one API
MIT License
58 stars 14 forks source link

Detect "already owned" message and unlock #8

Closed mikemee closed 4 years ago

mikemee commented 7 years ago

A Google Play customer reports that if she purchases on one device and then tries to refresh her 2nd device (using the same Play account), that the new purchase doesn't register for 1-2 days.

However, if she tries to purchase the same volume on the 2nd device, it says: "You already own this". However, our library doesn't handle this and unlock the volume.

Is there something we can do about this, or are we at the mercy of Google?

yurii-diachenko commented 7 years ago

@mikemee it seems to me that it's Google's issue. The reason why I think so is that:

  1. I didn't find "You already own this" or similar neither in library nor in application
  2. It refreshes only after 1-2 days but it does refrefreshes. In case it's something wrong on our side it wouldn't be refreshed on the second device at all
mikemee commented 7 years ago

@yurii-diachenko I see this code in the docs BILLING_RESPONSE_RESULT_ITEM_ALREADY_OWNED on this page: https://developer.android.com/google/play/billing/billing_reference.html. Would we handle this correctly if it is returned?

Specifically, when I look in https://github.com/eggheadgames/android-in-app-payments/blob/master/library/src/main/java/com/android/vending/billing/IabHelper.java, I see it is declared, but it never seems to be used.

Perhaps the Google example that we based this on never checked for this scenario ... and we should?

mikemee commented 7 years ago

Possibly helpful / related:

https://stackoverflow.com/questions/23696088/in-app-billing-verify-already-owned-result

https://stackoverflow.com/questions/31533335/inappbilling-v3-iabresult-response-code-billing-response-result-item-already-own

I think the sample code is trying to be careful about un-managed items (aka consumables) which can only be used on one device. But as our scenario has managed items, we want to allow customers to use the purchase immediately instead of having to wait 1-2 days.

yurii-diachenko commented 7 years ago

Makes sense, I'll take a closer look

mikemee commented 7 years ago

@yurii-diachenko Here's a screenshot that a customer sent us in case it helps:

2016-12-09_17-16-50