Automatically identify your users on your Android apps

Automatically identify your users on your Android apps

Last update: Vineri, Dec 20, 2024

Before identifying your users, you need to initialize the Xeno. If that's not done yet, please follow this documentation: Deploying in a native Android app

You can use the XenoIdentity class to identify your android app users to Xeno. This identity will be synced every time you'll call the Xeno.show() function.

// You can declare and initialize a new identity

XenoIdentity identity = XenoIdentity()

// then set attributes

identity.setId("qwerty123")
identity.setIdentityHash("backend_generated_hash") // Sha256 HMAC generated using your Brand Secret Key and the user ID (used in setId())
identity.setName("A Android User")
identity.setEmail("[email protected]")
identity.setAvatar("https://via.placeholder.com/200x200")
identity.setRegisteredAt("1565356073") // Should be a timestamp string
identity.setCustomAttribute("foo", "bar")) // Add any custom attribute you want

// and then set the identity

Xeno.setIdentity(identity)

// OR you can chain 'set' calls and set the identity

Xeno.setIdentity(
    XenoIdentity().setId("qwerty123").setIdentityHash("backend_generated_hash").setName("A Android User").setEmail("[email protected]")
)

Android SDK

4 article in this category.