Search Unity

How to consume non-consumable iap on Android

Discussion in 'Unity IAP' started by JuicyPixels, Oct 15, 2018.

Thread Status:
Not open for further replies.
  1. JuicyPixels

    JuicyPixels

    Joined:
    Sep 18, 2018
    Posts:
    4
    Is there a way to consume a non-consumable purchase on Android, which is needed for testing. At the moment we are stuck with unit iap on testing android devices and we also refunded the test purchases but non-consumable purchases keep getting restored in-game. That's why we are searching for a way to somehow consume or cancel non-consumable test purchases.
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    This is store behavior. It is generally recommended to create a new product for testing, or use a different user account.
     
  3. unityjingyao

    unityjingyao

    Unity Technologies

    Joined:
    Feb 20, 2017
    Posts:
    220
    It's possible for Google Play since Google Play only has Managed products. Consumable or Non-Consumable, it's up to you.
    In Unity IAP, if you want to consume a Non-Consumable product, you can change its 'ProductType' when calling 'AddProduct'. Then call 'IStoreController.ConfirmPendingPurchase' to consume it.
     
    NicholasPerell and GiyomuGames like this.
  4. JuicyPixels

    JuicyPixels

    Joined:
    Sep 18, 2018
    Posts:
    4
    Thanks!
     
  5. cdr9042

    cdr9042

    Joined:
    Apr 22, 2018
    Posts:
    173
    is it possible to consume non-consumable product on Apple App Store iOS? Is the process to do so the same on iOS?
     
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    No, it's not possible as far as I know since Apple explicitly offers non-consumable products. Why do you need to do so?
     
  7. cdr9042

    cdr9042

    Joined:
    Apr 22, 2018
    Posts:
    173
    I need to test Remove Ads.

    My game have remove ads product in shop, my game check for receipt and it finds that the product has valid receipt, the product will be greyed out and user can't buy it again.

    Now a tester test my game:
    Tester test buy remove ads -> OK the product work, all ads are removed.
    Now tester want to reset the game state to see the ads again, they reinstall app, but since remove ads is non-consumable, the game will give tester the Remove Ads product.
    Tester won't see any ads in game. The product in shop will be greyed out.

    But tester want to see ads in game, and the Remove Ad product in shop is available to purchase as if they have never bought it.
     
  8. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Got it! Please see the second post in this thread. https://forum.unity.com/threads/how-to-consume-non-consumable-iap-on-android.569335/#post-3787099
     
  9. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Locking thread. The solution is to create either a second test user or another non-consumable as originally mentioned
     
Thread Status:
Not open for further replies.