Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Getting nullPointerException when trying to get product price

Discussion in 'Unity IAP' started by E2TheFom, Aug 3, 2019.

?

Is the issue...

  1. Something I did wrong locally

    0 vote(s)
    0.0%
  2. Something I did wrong on my dashboard

    0 vote(s)
    0.0%
  3. both

    0 vote(s)
    0.0%
  1. E2TheFom

    E2TheFom

    Joined:
    Jul 26, 2018
    Posts:
    7
    Hello, I'm trying to retreive the price of my product from unity, and its giving me this error. I added the products onto my unity dashboard, so I'm not sure why its giving me problems.

    And I purposefully used a string literal to show that I couldn't have been passing a null parameter; that will change.

    dksaj fl;kj.PNG Capturefddf gds.PNG

    Hardest null pointer exception in my life...
     
  2. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,384
    You must add your products to the app store you are targeting (e.g. Google Play Store, Apple App Store, etc.):
    https://docs.unity3d.com/Manual/UnityIAPGoogleConfiguration.html
    https://docs.unity3d.com/Manual/UnityIAPAppleConfiguration.html

    (The products in the Unity dashboard are meant for IAP Promo, which is a product to advertise your In-app purchase products.)

    You must also define your products in the Editor, either through scripts or via the Product Catalog:
    https://docs.unity3d.com/Manual/UnityIAPDefiningProducts.html
     
unityunity