GetProducts type magic string and empty products array

  • 1 August 2023
  • 2 replies

Badge +6

In Unity SDK there is GetProducts method with this semantics:

public void GetProducts(string[] products, GetProductsFunc callback, string type = "subs")


How we should know this magic strings for “type”?


I want to display Price in game user interface. This price can be obtained through StoreProduct. But I can’t get ANY StoreProduct, because GetProducts alwats return empty array. I wanted to change type from “subs” to anything else, but there is no another constants mentioned in docs \ code.


Please help me to fetch all my products and check prices for them. 

Platform: Unity3d, Android & iOS


Best answer by sharif 3 August 2023, 22:46

View original

2 replies

Badge +6

Still can’t understand how this function works. For now we swith to GetOfferings because at least we understand how it works. For this we still need additional explanations \ docs. 

Userlevel 5
Badge +9


Thanks for the honest feedback, we’ll improve our docs here.

We do have a sample app that might help see the usage of our SDK, for example here’s a “GetAllProducts” method that gets all products by using GetOfferings and GetProducts:

The two values that type can be are “subs” and “inapp” as seen here:

I don’t expect you to dig through the code to find those, I’m simply sharing them here to help out. I’ll add a ticket in our system to document them.