Search Unity

  1. Going to #UniteBerlin? Bring a buddy & get 25% off the 2nd ticket! More info here.
    Dismiss Notice
  2. Famed game designer and creator of The Sims, SimCIty, and Spore is looking for a 3D artist to join their team. Join the challenge.
    Dismiss Notice
  3. Unity 2017.4 has arrived! Read about it here.
    Dismiss Notice
  4. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  5. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  6. We've opened a new World Building sub-forum to faciltate all your world building discussions! Drop in and ask any ProBuilder, ProGrids, or PolyBrush questions.
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Non consumable receipts won't be received

Discussion in 'Unity IAP' started by aurin, Apr 16, 2018 at 12:40 PM.

  1. aurin

    aurin

    Joined:
    Jun 7, 2013
    Posts:
    7
    Hello! I'm having a problem with receipts. We have non-consumable items in our app. Then we decided to apply Subscription Model and abandon purchasing non-consumable items. But we want to provide the items that the users bought BEFORE subscription model (in order not to be unfair to them) and provide other new items AFTER we release our subscription model. While we were testing our app in the beta realm, the receipts won't turn AFTER we uploaded the subscription model. All the items are LOCKED. But we want them unlocked. When we buy non-consumables in the subscription model (for testing purposes) their receipts return and we are able to unlock them. Can someone enlighten me on the receipt system? Is it about beta realm? Does google play reset our test purchases? How about the cache of unity iap system, Google is slow to update the cache? Why the purchased stuff's receipts won't be seen after the beta update? Thank you for the answers!

    Unity IAP : 1.18
    Unity : 2017.1.2f1
    Store: Google Play
     
    Last edited: Apr 16, 2018 at 12:45 PM
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    1,253
    You would want to create new/separate products for your subscriptions. Also, please define what you mean by locked to avoid confusion. And I'm not clear by what you mean by beta realm. I'm familiar with Alpha/Beta testing on Google play.
     
  3. aurin

    aurin

    Joined:
    Jun 7, 2013
    Posts:
    7
    The thing I want is to be able to get the items' receipts I bought before the latest build in beta. When I updated my app, all the things I bought vanished. (when you buy something from the app, the item is unlocked. When you don't the item is locked.) And the latest build has the subscription model, although I've added the non-consumables also into the configuration builder. before the subscription model, we had items AS non-consumable items. NOW we want to unlock them with the subscription model. but for the old users of the app, we want to provide the items they've bought. the ones that they did not buy will be unlocked by subscription. My items' receipts are not seen after the update. That is my problem.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    1,253
    You can't change the product type once you've configured a product. As mentioned, you'll need to create new subscription products.
     
  5. aurin

    aurin

    Joined:
    Jun 7, 2013
    Posts:
    7
    I did not change the products, I already have them as non-consumable. I just added extra subscriptions.But when I added them, the build did not return receipts of non-consumables and I did not remove them from Google Play.
     
  6. aurin

    aurin

    Joined:
    Jun 7, 2013
    Posts:
    7
    Think of it as non-consumable items + subscriptions. Only I just allow the subscriptions' purchase on the UI.
     
  7. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    1,253
    Do you get the ProcessPurchase method called on non-consumables during a reinstall? Receipts should not be necessary. If I understand your situation correctly, can you confirm: you originally had existing products that worked as expected. Then on an unrelated note, you added additional products to your existing game, introduced a new release (version) in your existing Beta channel, and suddenly you see unexpected behavior?
     
  8. aurin

    aurin

    Joined:
    Jun 7, 2013
    Posts:
    7
    yes, exactly. and in my code, it's like this:

    Code (CSharp):
    1. public void OnInitialized(IStoreController controller, IExtensionProvider extensions)
    2.         {
    3.             Debug.Log("OnInitialized: PASS");
    4.             m_StoreController = controller;
    5.             m_StoreExtensionProvider = extensions;
    6.             TryHandlePurchasedProducts();
    7.         }
    8. .
    9. .
    10. private void TryHandlePurchasedProducts()
    11.         {
    12.             foreach (Product product in m_StoreController.products.all)
    13.             {
    14.                 if (product.hasReceipt == true)
    15.                 {
    16.                     Debug.Log("product has receipt and such is the name: " + product.metadata.localizedTitle);
    17.                     string productId = product.definition.id;
    18.                     if(product.definition.type == ProductType.NonConsumable)
    19.                     {
    20.                         ProcessPreviousStoreUnlocks(productId);
    21.                     }
    22.                     else if (product.definition.type == ProductType.Subscription)
    23.                     {
    24.                         ProcessSubscriptionProductUnlocks();
    25.                     }
    26.                    
    27.                 }
    28.             }
    29.         }
    if I have the receipt everything works perfectly. But if I don't it does not work.
     
  9. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    1,253
    You are not showing your ProcessPurchase callback, or where you are adding your products. If you get the ProcessPurchase callback, that is all you should need.
     
  10. unityjingyao

    unityjingyao

    Unity Technologies

    Joined:
    Feb 20, 2017
    Posts:
    81
    Hi @aurin ,
    How did you handle the Non-Consumable product in the new version?
    Did you add the Non-Consumable product to ConfigurationBuilder before initialization?
    If you didn't, the Non-Consumable product would be consumed after initialization because you didn't specify its type and the default type is "Consumable".
     
  11. aurin

    aurin

    Joined:
    Jun 7, 2013
    Posts:
    7
    I did everything you mentioned and tweaked a little bit ProcessPurchase method to work with only ProductTypes. If productType is NonConsumable do this is Subscription do that. In beta, we created an account that bought nothing before. So from the production version, we bought one item, then switched to the beta one and the bought item is present. I think it is the end result we desired. (Although I think we should test it on production with real money, just in case) Thank you for mentioning ProcessPurchase, all!
     
  12. unityjingyao

    unityjingyao

    Unity Technologies

    Joined:
    Feb 20, 2017
    Posts:
    81
    What was the type of this item?
    Please note that subscription items will expire in minutes for a test purchase.

    Have you figured out your original issue?
    If you haven't, please open a ticket and send us the IAP script of both versions, so that we can test it out on our side.
    Thank you.
    https://analytics.cloud.unity3d.com/support/
     
  13. aurin

    aurin

    Joined:
    Jun 7, 2013
    Posts:
    7
    The type of the item I bought is NonConsumable.