Before identifying your users, you need to initialize the Slaask. If that's not done yet, please follow this documentation: Deploying in a native Android app
You can use the SlaaskIdentity
class to identify your android app users to Slaask. This identity will be synced every time you'll call the Slaask.show()
function.
// You can declare and initialize a new identity
SlaaskIdentity identity = SlaaskIdentity()
// 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
Slaask.setIdentity(identity)
// OR you can chain 'set' calls and set the identity
Slaask.setIdentity(
SlaaskIdentity().setId("qwerty123").setIdentityHash("backend_generated_hash").setName("A Android User").setEmail("[email protected]")
)