Search Unity

Non consumable receipts won't be received

Discussion in 'Unity IAP' started by eylulatilgan, Apr 16, 2018.

  1. eylulatilgan

    eylulatilgan

    Joined:
    Jun 7, 2013
    Posts:
    12
    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
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    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. eylulatilgan

    eylulatilgan

    Joined:
    Jun 7, 2013
    Posts:
    12
    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

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

    eylulatilgan

    Joined:
    Jun 7, 2013
    Posts:
    12
    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. eylulatilgan

    eylulatilgan

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

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    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. eylulatilgan

    eylulatilgan

    Joined:
    Jun 7, 2013
    Posts:
    12
    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

    Joined:
    May 2, 2017
    Posts:
    14,446
    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:
    220
    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. eylulatilgan

    eylulatilgan

    Joined:
    Jun 7, 2013
    Posts:
    12
    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:
    220
    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. eylulatilgan

    eylulatilgan

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