Legacy Documentation: Version 5.4
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

IDs Constructor

Suggest a change

Success!

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.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public IDs()
public IDs();

Description

Create 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; } }