Search Unity

[Solved] One(!) product ist not avaiable

Discussion in 'Unity IAP' started by FlashMuller, Jan 17, 2018.

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

    FlashMuller

    Joined:
    Sep 25, 2013
    Posts:
    450
    So I have Unity IAP Set up, and I would claim that I set it up correctly. I have 3 products. 2 have been around for a while and work just fine, the third one is claimed to be "Product not avaiable". And before you ask: I double- and triple checked. The configuration in Unity and the Developer Console match, the implementation is identical to the other products which work, I even created another new product which just as well refuses to work. I feel like the issue might be in connection to cached information, but reinstalling the app didn't help.
    I have no clue where to even start debugging.
    Any thoughts?
    Thanks!
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @FlashMuller Please provide the device logs during a session where you you see this behavior, and we can take a look. Generally I use "adb logcat | grep -i unity" or similar.
     
  3. FlashMuller

    FlashMuller

    Joined:
    Sep 25, 2013
    Posts:
    450
    Hey @JeffDUnity3D ,
    I got the following infos using logcat -s Unity (which should be the same?).
    Heres the result, I marked what I think is interesting:

    01-19 08:12:11.478 13073 13088 I Unity : IAP Init successful
    01-19 08:12:11.478 13073 13088 I Unity : UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
    01-19 08:12:11.478 13073 13088 I Unity : UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    01-19 08:12:11.478 13073 13088 I Unity : UnityEngine.Logger:Log(LogType, Object)
    01-19 08:12:11.478 13073 13088 I Unity : UnityEngine.Debug:Log(Object)
    01-19 08:12:11.478 13073 13088 I Unity : StoreManager:OnInitialized(IStoreController, IExtensionProvider) (at D:\htmGames\Projects\Unity Projects\Trains\Assets\Mechanics\Advertising\StoreManager.cs:44)
    01-19 08:12:11.478 13073 13088 I Unity : UnityEngine.Purchasing.StoreListenerProxy:OnInitialized(IStoreController) (at /Users/justing/development/unity1/Extensions/UnityPurchasing/Runtime/Purchasing/StoreListenerProxy.cs:23)
    01-19 08:12:11.478 13073 13088 I Unity : UnityEngine.Purchasing.PurchasingManager:CheckForInitialization() (at /Users/justing/development/unity1/Extensions/UnityPurchasing/Runtime/Purchasing/PurchasingManager.cs:232)
    01-19 08:12:11.478 13073 13088 I Unity : UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1) (at /Users/justing/development/unity1/Extensions/UnityPurchasing/Runtime/Purchasing/PurchasingManager.cs:173)
    01-19 08:12:11.478 13073 13088 I Unity : UnityEngine.Purchasing.JSONStore:OnProductsRetrieved(String)
    01-19 08:12:11.478 13073 13088 I Unity : UnityEngine.Purchasing.<>c__Displ
    01-19 08:12:11.481 13073 13088 I Unity : ID: remove_ads; sID: remove_ads; Descr: Remove all ads from this game.
    01-19 08:12:11.481 13073 13088 I Unity : UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
    01-19 08:12:11.481 13073 13088 I Unity : UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    01-19 08:12:11.481 13073 13088 I Unity : UnityEngine.Logger:Log(LogType, Object)
    01-19 08:12:11.481 13073 13088 I Unity : UnityEngine.Debug:Log(Object)
    01-19 08:12:11.481 13073 13088 I Unity : StoreManager:OnInitialized(IStoreController, IExtensionProvider) (at D:\htmGames\Projects\Unity Projects\Trains\Assets\Mechanics\Advertising\StoreManager.cs:47)
    01-19 08:12:11.481 13073 13088 I Unity : UnityEngine.Purchasing.StoreListenerProxy:OnInitialized(IStoreController) (at /Users/justing/development/unity1/Extensions/UnityPurchasing/Runtime/Purchasing/StoreListenerProxy.cs:23)
    01-19 08:12:11.481 13073 13088 I Unity : UnityEngine.Purchasing.PurchasingManager:CheckForInitialization() (at /Users/justing/development/unity1/Extensions/UnityPurchasing/Runtime/Purchasing/PurchasingManager.cs:232)
    01-19 08:12:11.481 13073 13088 I Unity : UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1) (at /Users/justing/development/unity1/Extensions/UnityPurchasing/Runtime/Purchasing/PurchasingManager.cs:173)
    01-19 08:12:11.481 13073 13088 I Unity : UnityEngine.Purchasing.JSONStore:OnProducts
    01-19 08:12:11.483 13073 13088 I Unity : ID: looser_package; sID: looser_package; Descr: Lost again? Try again! Ignore crashes, collapses and bancrupts (3x each)
    01-19 08:12:11.483 13073 13088 I Unity : UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
    01-19 08:12:11.483 13073 13088 I Unity : UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    01-19 08:12:11.483 13073 13088 I Unity : UnityEngine.Logger:Log(LogType, Object)
    01-19 08:12:11.483 13073 13088 I Unity : UnityEngine.Debug:Log(Object)
    01-19 08:12:11.483 13073 13088 I Unity : StoreManager:OnInitialized(IStoreController, IExtensionProvider) (at D:\htmGames\Projects\Unity Projects\Trains\Assets\Mechanics\Advertising\StoreManager.cs:47)
    01-19 08:12:11.483 13073 13088 I Unity : UnityEngine.Purchasing.StoreListenerProxy:OnInitialized(IStoreController) (at /Users/justing/development/unity1/Extensions/UnityPurchasing/Runtime/Purchasing/StoreListenerProxy.cs:23)
    01-19 08:12:11.483 13073 13088 I Unity : UnityEngine.Purchasing.PurchasingManager:CheckForInitialization() (at /Users/justing/development/unity1/Extensions/UnityPurchasing/Runtime/Purchasing/PurchasingManager.cs:232)
    01-19 08:12:11.483 13073 13088 I Unity : UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1) (at /Users/justing/development/unity1/Extensions/UnityPurchasing/Runtime/Purchasing/PurchasingManager.c
    01-19 08:12:11.485 13073 13088 I Unity : ID: build_mode; sID: build_mode; Descr:
    01-19 08:12:11.485 13073 13088 I Unity : UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
    01-19 08:12:11.485 13073 13088 I Unity : UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    01-19 08:12:11.485 13073 13088 I Unity : UnityEngine.Logger:Log(LogType, Object)
    01-19 08:12:11.485 13073 13088 I Unity : UnityEngine.Debug:Log(Object)
    01-19 08:12:11.485 13073 13088 I Unity : StoreManager:OnInitialized(IStoreController, IExtensionProvider) (at D:\htmGames\Projects\Unity Projects\Trains\Assets\Mechanics\Advertising\StoreManager.cs:47)
    01-19 08:12:11.485 13073 13088 I Unity : UnityEngine.Purchasing.StoreListenerProxy:OnInitialized(IStoreController) (at /Users/justing/development/unity1/Extensions/UnityPurchasing/Runtime/Purchasing/StoreListenerProxy.cs:23)
    01-19 08:12:11.485 13073 13088 I Unity : UnityEngine.Purchasing.PurchasingManager:CheckForInitialization() (at /Users/justing/development/unity1/Extensions/UnityPurchasing/Runtime/Purchasing/PurchasingManager.cs:232)
    01-19 08:12:11.485 13073 13088 I Unity : UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1) (at /Users/justing/development/unity1/Extensions/UnityPurchasing/Runtime/Purchasing/PurchasingManager.cs:173)
    01-19 08:12:11.485 13073 13088 I Unity : UnityEngine.Purchasing.JSONStore:OnProductsRetrieved(String)
    01-19 08:12:11.485 13073 13088 I Unity : UnityEngine.


    01-19 08:13:51.536 13073 13088 I Unity : ProductUnavailable
    01-19 08:13:51.536 13073 13088 I Unity : UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
    01-19 08:13:51.536 13073 13088 I Unity : UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    01-19 08:13:51.536 13073 13088 I Unity : UnityEngine.Logger:Log(LogType, Object)
    01-19 08:13:51.536 13073 13088 I Unity : UnityEngine.Debug:Log(Object)
    01-19 08:13:51.536 13073 13088 I Unity : StoreManager:OnPurchaseFailed(Product, PurchaseFailureReason) (at D:\htmGames\Projects\Unity Projects\Trains\Assets\Mechanics\Advertising\StoreManager.cs:94)
    01-19 08:13:51.536 13073 13088 I Unity : UnityEngine.Purchasing.StoreListenerProxy:OnPurchaseFailed(Product, PurchaseFailureReason) (at /Users/justing/development/unity1/Extensions/UnityPurchasing/Runtime/Purchasing/StoreListenerProxy.cs:40)
    01-19 08:13:51.536 13073 13088 I Unity : UnityEngine.Purchasing.PurchasingManager:InitiatePurchase(Product, String) (at /Users/justing/development/unity1/Extensions/UnityPurchasing/Runtime/Purchasing/PurchasingManager.cs:56)
    01-19 08:13:51.536 13073 13088 I Unity : UnityEngine.Purchasing.PurchasingManager:InitiatePurchase(String, String) (at /Users/justing/development/unity1/Extensions/UnityPurchasing/Runtime/Purchasing/PurchasingManager.cs:69)
    01-19 08:13:51.536 13073 13088 I Unity : UnityEngine.Purchasing.PurchasingManager:InitiatePurchase(String) (at

    A little Explanation:
    After having succesfully initialized IAP I log the products-list. Two things are striking here:
    1. the defect product (build_mode) does not have a description. I guess it is only using the in code provided IDs
    2. The description of looser_package is actually wrong. It has been updated some time (months) ago and just never changed.

    To me that sounds like some sort of caching issue? Let me know if you need any other information than that.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    The discrepancies, like the outdated description that you described, are configured in Google Play, which we retrieve. Any caching (which I have not heard of any such behavior) would be on the Google side. Can you show a screenshot of your products as configured on Google Play? Since the description is outdated and new products are not showing, that may imply that you are connecting to the wrong app on Google. Also, spelling is critical, I noticed a few errors. Please provide your purchase script. Alternatively, you can open a support ticket where you can supply this information and add me as a tester https://analytics.cloud.unity3d.com/support/
     
  5. FlashMuller

    FlashMuller

    Joined:
    Sep 25, 2013
    Posts:
    450
    Hey @JeffDUnity3D ,
    so here is a screenshot of the products in the Play Console. Is that what you need?
    Setup_Console.PNG

    Here is the code - Initialization:
    Code (CSharp):
    1. var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
    2.  
    3.         IDs rid = new IDs();
    4.         rid.Add("remove_ads", GooglePlay.Name);
    5.         builder.AddProduct("remove_ads", ProductType.NonConsumable, rid);
    6.  
    7.         IDs lid = new IDs();
    8.         lid.Add("looser_package", GooglePlay.Name);
    9.         builder.AddProduct("looser_package", ProductType.Consumable, lid);
    10.  
    11.         IDs bpid = new IDs();
    12.         bpid.Add("build_mode", GooglePlay.Name);
    13.         builder.AddProduct("build_mode", ProductType.NonConsumable, bpid);
    14.        
    15.         UnityPurchasing.Initialize(this, builder);
    A purchase happens simply through:

    Code (CSharp):
    1. controller.InitiatePurchase(productID);
    Let me know if you need anything else and thanks for your effort
     
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please open a support ticket and provide a minimal project that reproduces this issue.
     
  7. FlashMuller

    FlashMuller

    Joined:
    Sep 25, 2013
    Posts:
    450
    Found a solution @JeffDUnity3D, maybe it helps others:
    The correct purchases and descriptions showed up after I updated the APK (in alpha) on Google Play without (!) actually downloading this new APK. I'm not sure if this is documented somewhere but it seems as if editing In-App-Products without uploading a new APK won't really update the store entry, at least as long as you are in Alpha or Beta.
    To make it clear. I had a version on my device which did not work. Uploaded that version to Google Play in Alpha-Status (for the first time in weeks) and without updating on my device suddenly IAP works just fine.
     
    ap-unity likes this.
  8. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @FlashMuller,

    Thanks for sharing how you fixed this. It should help us resolve this issue if it comes up again for other customers.
     
Thread Status:
Not open for further replies.