Select your preferred scripting language. All code snippets will be displayed in this language.
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
CloseFor some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
CloseCreate a new mapping of store identifiers to store names.
Here is an example of constructing an IDs
for a store class:
#pragma strict public class MyStoreConfiguration { public static function CreateBuilder() { var builder: ConfigurationBuilder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance()); // except for GooglePlay and WinRT where it is "com.unity3d.purchasing.levelpackfoo". var productIds: IDs = new IDs(); builder.AddProduct("levelpackfoo", ProductType.NonConsumable, productIds); return builder; } }
using UnityEngine.Purchasing;
public class MyStoreConfiguration { public static ConfigurationBuilder CreateBuilder() { ConfigurationBuilder builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance()); // Use this approach when products have different identifiers on different stores. // Here, the store-specific ID is "levelpackfoo" for AppleAppStore and all others, // except for GooglePlay and WinRT where it is "com.unity3d.purchasing.levelpackfoo". IDs productIds = new IDs() { { "levelpackfoo" }, { "com.unity3d.purchasing.levelpackfoo", GooglePlay.Name, WinRT.Name } }; builder.AddProduct("levelpackfoo", ProductType.NonConsumable, productIds); return builder; } }