TryYourSize(context, publishableKey, configuration)
Creates the client for your publishable key. Keep one per app.
public class TryYourSize @JvmOverloads constructor( context: Context, public val publishableKey: String, public val configuration: Configuration = Configuration(),)Parameters
Section titled “Parameters”contextContextRequiredAny context; the application context is kept.
publishableKeyStringRequiredYour publishable key (pk_test_… / pk_live_…).
configurationConfigurationOptional= Configuration()See Configuration(/reference/android/configuration/).
Errors
Section titled “Errors”TryYourSizeException with code SECRET_KEY_IN_APP, INVALID_KEY, INVALID_APP_IDENTIFIER or INVALID_OPTION.
Example
Section titled “Example”val tys = TryYourSize(context, "pk_test_…", TryYourSize.Configuration( appearance = Appearance(borderRadius = 10f), locale = "es",))let tys = try TryYourSize(publishableKey: "pk_test_…", configuration: .init( appearance: Appearance(borderRadius: 10), locale: "es"))await configure("pk_test_…", { appearance: { variables: { borderRadius: 10 } }, locale: "es" });final tys = await TryYourSize.create('pk_test_…', appearance: const Appearance(borderRadius: 10), locale: 'es');Was this page helpful?
Thank you. We read every answer.