Set desired store at runtime with Cloudbuild

HI, im having trouble settings the desired store at runtime. Im currently building with UnityCloud and need to set the required store at runtime.

I have a conditional flag for the Amazon build (“KINDLE”).

StandardPurchasingModule storeModule;

#if KINDLE
    storeModule = StandardPurchasingModule.Instance(AppStore.AmazonAppStore);
#else
    storeModule = StandardPurchasingModule.Instance();
#endif

    // Create a builder, first passing in a suite of Unity provided stores.
    var builder = ConfigurationBuilder.Instance(storeModule);

however when i upload to the Amazon store it fails because the Store is incorrect. If i build locally and manual set the Store via the Unity IAP menu, it works.

Please could someone let me know what I am doing wrong here.

Thanks!

May this help?
https://discussions.unity.com/t/590185/4

Thanks for the reply.

Im actually using a custom definition. I set this in the Cloud Console “KINDLE”.

The code executes but it seems like setting the store module this way doesnt work.

When i change the Store via the menu, i see it changes iap store settings json file that is loaded in via the resources.

Seems like no matter what I do, whatever is in the json file overwrites my code.