Ir al contenido

Android reference (TryYourSize for Kotlin)

Esta página aún no está disponible en tu idioma.

SDKcom.tryyoursize:tryyoursize-androidv0.1.0

minSdk 24, Jetpack Compose and Views. The window needs an androidx ComponentActivity (for example AppCompatActivity). Register your app for the key in Studio as android-app://<package> (test mode today; live mode for apps is coming soon).

dependencies { implementation("com.tryyoursize:tryyoursize-android:0.1.0") }
val tys = TryYourSize(context, "pk_test_…") // a secret key throws

Error codes: Mobile SDK errors.

constructor Creates the client for your publishable key.
Configuration TryYourSize.Configuration
recommendation() The shopper’s recommended size for a product, in your size labels.
getRecommendation() The same, with a callback (Java).
onRecommendation() Calls handler now (once known) and on every change: signing in, a new body, a simulation finishing.
on (events) Window events: Ready, Open, Close, Size, LoadError.
present() Opens the measuring / try-on window for a product, full screen over activity.
appearance Live restyle (e.g.
appOrigin android-app://<package>: what the store registers as an allowed origin.
SizeGuide The “Size guide” button: “Size guide” → “Calculating your size…” → “Your size: M”.
SizeGuideView The same button as an Android View: set client and product.
Recommendation The shopper’s recommended size for one product, in the store’s own size labels.
Appearance Colours (ARGB ints), font and corner radius for the button and the window.
TryYourSizeException Every error the SDK raises: a stable code, a message and a doc link (like the web SDK).

¿Te ha resultado útil esta página?