Search Unity

Google Play You already own this item

Discussion in 'Unity IAP' started by Wadjey, Dec 1, 2020.

  1. Wadjey

    Wadjey

    Joined:
    Feb 4, 2015
    Posts:
    244
    Hi,
    When I try to purchase some of my consumable IAP items I'm getting the "You already own this item" in Play Store and I have a log message "Already recorded transaction someTransctionCodexxxxxxx".
    I've initialized my IAP items with the consumable argument:

    Code (CSharp):
    1. var ids = new IDs()
    2. {
    3.     { iap.skuApple, AppleAppStore.Name},
    4.     { iap.skuGoogle, GooglePlay.Name},
    5.     { iap.skuAmazon, AmazonApps.Name},
    6.     { iap.skuSamsung, SamsungApps.Name},
    7. };
    8.  
    9. builder.AddProduct(iap.id, ProductType.Consumable, ids);

    And in the ProcessPurchase(PurchaseEventArgs e) method I'm returning PurchaseProcessingResult.Complete.
    Also I tried to manually consume these remaining items by adding m_Controller.ConfirmPendingPurchase(e.purchasedProduct) to the ProcessPurchase method but the same problem remains!
    Tried to restart my device, clear Google Play cache/data, reinstall my game, and the problem still remains!
    I'm using Unity 2019.4.15f1 and Unity IAP 2.2.2 and In App Purchasing 2.1.1

    Any idea how to fix this issue?
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
  3. Wadjey

    Wadjey

    Joined:
    Feb 4, 2015
    Posts:
    244

    Attached Files:

    • log.txt
      File size:
      51 KB
      Views:
      270
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
  5. Wadjey

    Wadjey

    Joined:
    Feb 4, 2015
    Posts:
    244
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I will look forward to your test with the sample project, I appreciate your help. It would be the same test I would run, but I'm booked full at the moment. I was able to purchase a consumable product multiple times just yesterday with this same sample app, and didn't see the same issue you are seeing.
     
  7. Wadjey

    Wadjey

    Joined:
    Feb 4, 2015
    Posts:
    244
    I think for some reason, after updating to Unity IAP 2.2.2, I got some exceptions and the ProcessPurchase(PurchaseEventArgs e) method wasn't called and then the items wasn't consumed!
    That's why I tried to consume these items manually by calling m_Controller.ConfirmPendingPurchase(e.purchasedProduct) into the ProcessPurchase method, but the issue remains, even after rbooting the device and reinstalling the app.
    When I reinstall the app I see that the ProcessPurchase(PurchaseEventArgs e) method is called by itself to restore these purchases, and that call happens again each time I uninstall and reinstall the game.
    I hope these information will help to investigate the issue.
     
  8. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You should not be using ConfirmPendingPurchase to work around another error. Please compare to the Sample project, then will both of us will have the same project to test with. You mentioned you "got some exceptions", unfortunately I would not know which errors you might be referring to. Also, only non-consumable products would be expected to Restore, not consumables. Make sure that you don't change the product type once you create them.
     
  9. Wadjey

    Wadjey

    Joined:
    Feb 4, 2015
    Posts:
    244
    I just downgraded to Unity IAP v1.23.5 and the problem is resolved and I'm able to purchase the items again!
    It seems a bug in the latest version of Unity IAP.
     
    JeffDUnity3D likes this.
  10. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Well that is interesting, nice work. I will test here similarly, thanks for the update.
     
    Wadjey likes this.
  11. Wadjey

    Wadjey

    Joined:
    Feb 4, 2015
    Posts:
    244
    Is this issue fixed in Unity IAP v2.2.3 ?
     
  12. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I haven't had a chance to test yet since my post yesterday, so likely not
     
  13. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Last edited: Dec 4, 2020
  14. Wadjey

    Wadjey

    Joined:
    Feb 4, 2015
    Posts:
    244
    Maybe it's fixed in this latest version! Are you able to reproduce it with IAP v2.2.2 to be sure that this bug is really fixed in the latest version?
     
  15. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I would ask you to test locally with 2.2.3. It doesn't require a new version to be uploaded to Google. I was able to add new products too, all while directly side-loading via USB.