Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
victoryvr's avatar
victoryvr
Explorer
4 years ago

IAP GetProductList returning null?

Hey community,

So I followed a couple tutorials to make sure I was setting this up right. However, everytime I try to grab the GetProductList it seems to be a null reference "NullReferenceException: Object reference not set to an instance of an object".

 

The app is on App Lab, has 3 products, one not published, and the other two published and all three have every section filled out (Images, name, descriptions, etc).

 

I have some images below of how the system is setup, if anyone knows why this is happening and a fix I would love to hear it!

 

The error is where it says Debug.Log(msg.GetProductList().Count);

3 Replies

Replies have been turned off for this discussion
  • Jepplen's avatar
    Jepplen
    Expert Protege

    Hi, I'm having the exact same problem and using the exact same code.

    Did you ever find any solution to it?

    • Jepplen's avatar
      Jepplen
      Expert Protege

      Ok so i got it to work for me.
      I was missing the Oculus EntitlementCheck.cs in my scene.
      Also don't forget to add your AppId as a string argument like this: 

      Oculus.Platform.Core.Initialize("<your app id here>");

      There might be a way to add it via Unity inspector somewhere, I read some hints about that, but I don't know.

      Super confusing because in some docs I read that the EntitleMentCheck is not needed for AppLab, but I guess that doesn't apply for IAP requests.

      Well, hope this helps someone else's headache.

  • I would love to get more instructions on becoming a partner with unity