Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity IAP - CodelessIAPStoreListener attempted to get unknown product

Discussion in 'Unity IAP' started by Sagnog01, Jun 11, 2021.

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

    Sagnog01

    Joined:
    Apr 20, 2017
    Posts:
    6
    Hey,

    I'm using Unity IAP on both Android and iOS devices.

    They work fine on both platforms and we are indeed receiving some purchases on AppStore and Google Play.

    However, in Game Analytics, I can see this error that's appearing multiple times:

    CodelessIAPStoreListener attempted to get unknown product

    It seems for some devices, Unity IAPs can't load the product.

    Does anybody know why and when this happens?
    Any way to solve it?

    Thank you
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    We have heard of this issue but have been unable to reproduce. Have you found anything in common with the users that are seeing this error?
     
  3. Sagnog01

    Sagnog01

    Joined:
    Apr 20, 2017
    Posts:
    6
    Not anything specific.

    I've tried a couple of things but I also couldn't reproduce it on my end.
    Do you know if this happens when they press the button to buy the IAP? Or is it after they put the credit cards or other info?
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Typically the listener is only used right at app start, perhaps during a Restore operation. I might suggest to use Scripted IAP instead, it's easier to track down issues like this. This might help you get started, depends on how important this is to you to rewrite your code https://forum.unity.com/threads/sample-iap-project.529555/#post-6950270
     
  5. denis_bogdanov

    denis_bogdanov

    Joined:
    Apr 20, 2015
    Posts:
    139

    The same problem, but only appears on emulators - Nox and Bluestacks.
    Everything is fine on devices and editor
     
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    IAP would not work on emulators.
     
    denis_bogdanov likes this.
  7. denis_bogdanov

    denis_bogdanov

    Joined:
    Apr 20, 2015
    Posts:
    139
    Oh, i didn't know that, thanks
     
  8. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    This is for security since the transaction requires a credit card and phone security (touchID, faceID, password, etc)
     
    denis_bogdanov likes this.
  9. Exopole

    Exopole

    Joined:
    Apr 11, 2017
    Posts:
    3
    Hey,

    I have the same error in android in a unpublish application, only internal test. So my question is : is this error normal for this case ?
     
    Last edited: Sep 18, 2021
  10. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Generally errors are never "normal". Does IAP work for you?
     
  11. breban1

    breban1

    Joined:
    Jun 7, 2016
    Posts:
    194
    Sorry to necro but I was having this same error with an Android (Google Play) build today and resolved it by waiting for CodelessIAPStoreListener.initializationComplete before enabling the listener object.

    Hope this helps someone else!
     
  12. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Can you share your code? How could the InitializationComplete event fire if the listener object is not enabled? Perhaps I'm not following, but Codless (as the name implies), should not need any additional code. It's advised to avoid Codeless for now, it may eventually be deprecated. It's missing several features like receipt validation and subscription support. It might be suggested to start with the Sample IAP Project here: https://forum.unity.com/threads/sample-iap-project.529555/#post-7922275
     
  13. breban1

    breban1

    Joined:
    Jun 7, 2016
    Posts:
    194
    Code (CSharp):
    1.         private void Awake()
    2.         {
    3.             iapListenerObject.SetActive(false); // gets activated once IAP is initialized
    4.         }
    5.         void Update()
    6.         {
    7.             if (CodelessIAPStoreListener.initializationComplete)
    8.             {
    9.                 iapListenerObject.SetActive(true);
    10.             }
    11.         }
    12.  
    13.  
    1) The iapListenerObject GameObject is disabled in the scene.
    2) Automatically initialize Unity Purchasing is checked in Services->In-App Purchasing->IAP Catalog

    Codeless IAP is really easy to use, I hope you all support it further. I have a game to make lol!
    (Sorry for the quick edit on the reply)
     
  14. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You want to avoid Codeless, it likely will not be supported moving forward. You would want to switch right away.
     
  15. breban1

    breban1

    Joined:
    Jun 7, 2016
    Posts:
    194
    I will take a look at the example and give it a go. Thanks for the info.
     
  16. SanketVaria

    SanketVaria

    Joined:
    Aug 27, 2017
    Posts:
    17
    I am having the same problem. Unity 2021 and IAP 4.1.4. error: CodelessIAPStoreListener attempted to get unknown product
     
  17. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please see my previous post. Locking this thread.
     
Thread Status:
Not open for further replies.