User API
Access user and profile operations through AzeooSDK.shared.user. The user API is available after connectUser has been called successfully.
Accessβ
val user: AzeooUser = AzeooSDK.shared.user
Methods (overview)β
- profile β Cached profile (
AzeooUserProfile?) when available. - getProfile(callback) β Returns the current user profile via callback.
- getId(callback), getName(callback), getEmail(callback), getHeight(callback), getWeight(callback), getGender(callback), getBirthDateTimestamp(callback) β Convenience accessors.
- updateProfile(data, callback) β Updates profile with the given map; returns updated profile via callback.
- refreshProfile(callback) β Refetches profile from the server.
- uploadImage(imageData, callback) β Uploads profile image; returns URL via callback.
User settings methods (getSettings / updateSettings) are available on the nutrition module API (AzeooSDK.shared.modules.nutrition), not on AzeooSDK.shared.user.
Exact signatures and callback style follow the Android SDK implementation. See the API Reference or the SDK source for the current method list.
Exampleβ
AzeooSDK.shared.connectUser(
token = userToken,
gender = gender,
height = height,
weight = weight,
) { _, error ->
if (error == null) {
AzeooSDK.shared.user.getName { nameResult ->
nameResult.onSuccess { name -> /* ... */ }
}
AzeooSDK.shared.user.getEmail { emailResult ->
emailResult.onSuccess { email -> /* ... */ }
}
// Update profile
AzeooSDK.shared.user.updateProfile(mapOf("name" to "New Name")) { updateResult ->
updateResult.onSuccess { updated -> /* ... */ }
}
}
}
Next stepsβ
- Theme and modules β Theme and nutrition
- SDK entry point β init and connect