Does ConfigurationBuilder support many-to-one store-specific product id mappings?

When adding a product you provide a global product id that is independent of any platform store. And you also optional store-specfic ids. For example: global id: value100_package, google id: value_package_google3

Here is my question. Can I add multiple products where the same store-specific id is reused? (The global ids will always be unique though.) Example:

  • value100_package, google id: value_package_google3
  • value107_package, google id: value_package_google3

This might seem worthless to anyone reading. But it is valuable in practice. I can explain why if anyone asks but I won’t for now so I don’t make this post long.

1 Like

Do they map to the same product as configured on the Google Play Developer Dashboard? Are you seeing unexpected behavior?

Yes they will map to the same product. The way our server works (a long-standing popular existing casino) is that we can allow users to buy different amounts of credits or apply different sorts of promos, but they just tie back to a specific existing product as defined in the Google Play or Apple stores. So we could have literally unlimited products in our server, and like 20 in each platform-specific dashboard/store.

I am not seeing odd behavior. I’m at the design stage for the application and this information wasn’t available in the documentation. The answer will vary my design (because I’d have to essentially build that functionality myself).

Thanks for the assistance.

Understood, I will confirm the expected behavior with the IAP team.

Hi Jeff - were you able to discuss with the IAP team?

@gmakar I did touch base with the team, and they mentioned that it should work but has not been tested.

1 Like

Hi,

I thought I would resurface this post as we have recently tested using Unity IAP as our native purchasing solution, where we are using a similar approach with “many to one” product ↔ storeId, i.e. multiple products in-game can map to the same store IAP product.

We were unable to initialise UnityPurchasing due to the UnityEngine.Purchasing.ProductCollection restriction that a store specific ID must map to exactly one Product. This is enforce by the Dictionary data structure which will throw an System.ArgumentException when an item of the same name already exists.

I haven’t found any information online with regards to a Unity IAP solution to this problem if one does exist. I wanted to find out if this is known limitation or if there is a work around that I haven’t found yet?

Cannot you simply use the same ProductID for all these available products in the game? For example, I have one button that sells myProduct1 as configured on Google Play. The label of the button says “Great Product”. Then I duplicate this button that still points to myProduct1, and change the label only to “Amazing Product”. Two buttons, same product. Also, in the users Google account, it would just say “This user has purchased qty = 2 for myProduct1”, what is your expectation? Granted, Restore would be problematic. How do you plan to keep the in-game products separate if you desire them to map to a single store IAP?

Hi Jeff,

Thanks for the swift reply. As a more concrete explanation; in game we have quite a few different bundles (soft/hard currency, equipment) and each of these bundles have different tiers (small, medium and large). From a production point of view they want to chop and change the price points on each without having to create a new IAPs in the native store each time, e.g:

  • Name id Price

  • Bundle app_bndl_001 GBP 5.79

  • Bundle app_bndl_002 GBP 3.99

  • Bundle app_bndl_003 GBP 4.99

Production have set the in-game content (soft/hard currency and equipment) for the “Medium Region 01” bundle and go with the “app_bndl_002” as the storeId as the price point. When designing the “Small Region 02” they decide they want the same price point so set the storeId to “app_bndl_002”. Later if they want to change the price point of said bundles they can just update the storeId field of the in-game products.

Each in-game bundle (Product) will have a unique id that is saved with the storeId when a purchase is made and the content of the bundle is applied against their Player Profile.

We would not be restoring purchases through the client side stores as all purchases are saved against the Player Profiles in the cloud and as such can be retrieved at a later date on another device. All IAP will be consumables.

(NB: being devil’s advocate here a bit as there are other ways to achieve the same result)

Got it! Yes this could work, as they are all consumables and you are storing purchase info in the cloud. Unfortunately this feature is not currently available via Unity IAP. You might take a look at Game Foundation, they have an abstraction layer above IAP, but not sure it would apply in your situation https://docs.unity3d.com/Packages/com.unity.game.foundation@0.6/manual/Tutorials/14-WorkingWithStorePrefabs.html