π SDK entry point (initialize and connect)
The Azeoo SDK is used through AzeooSDK: call initialize once, then connectUser when the user is authenticated.
Import from com.azeoo.sdk.core.*.
initializeβ
fun initialize(
context: Context,
apiKey: String,
environment: String = "production",
config: AzeooConfig? = null,
theme: AzeooThemeConfig? = null,
deepLinks: AzeooDeepLinkConfig? = null,
safeArea: AzeooSafeAreaConfig? = null,
connector: AzeooConnectorConfig? = null,
callback: (error: Exception?) -> Unit
)
Starts the Flutter engine, waits for Dart readiness, validates the API key with the server, then invokes callback.
Parameters:
contextβ Application contextapiKeyβ Your Azeoo SDK API keyenvironmentβ"production"or"staging"(optional)configβ Optional: locale, analyticsEnabled, offlineEnabled, connectionTimeoutSecondsthemeβ Optional theme colors (light/dark primary, secondary, etc.)deepLinksβ Optional deep link scheme/host/pathPrefixsafeAreaβ Optional safe area insets (top, bottom, left, right)connectorβ Optional connector config β see Connectorscallbackβnullon success,Exceptionon failure
The legacy init method no longer exists. Always use initialize and wait for the callback before connectUser.
sharedβ
val shared: AzeooSDK
The singleton SDK instance. Throws if initialize has not completed successfully.
connectUserβ
fun connectUser(
token: String,
gender: String,
height: AzeooHeight,
weight: AzeooWeight,
callback: (user: AzeooUserProfile?, error: Exception?) -> Unit
)
Authenticates the user. Must be called before using modules or the user API.
Parameters:
tokenβ User JWT from your backendgenderβ User gender stringheightβAzeooHeightvalue objectweightβAzeooWeightvalue objectcallbackβ Profile on success (profile.idis the Azeoo user id), error on failure
The user id is inside the JWT and returned in profile.id. Do not pass a separate userId parameter.
onReadyβ
fun onReady(callback: (Result<Unit>) -> Unit)
Registers a callback invoked when initialization completes. If already initialized, the callback runs immediately.
isReady / isInitializedβ
val isReady: Boolean
val isInitialized: Boolean
val isUserConnected: Boolean
isReady β Flutter side ready and no initialization error.
setClubIdβ
fun setClubId(clubId: Long, callback: (error: Exception?) -> Unit)
Switches the active club for an azeoo connector. Re-exchanges SDK tokens and preserves the user session.
disconnectβ
fun disconnect(callback: (error: Exception?) -> Unit)
Disconnects the current user. The SDK remains initialized; you can call connectUser again.
disposeβ
fun dispose()
Releases SDK resources. Call when shutting down or when you need a full reset. Call initialize again to restart.
listenerβ
var listener: AzeooSDKListener?
Optional listener for Flutter β native events. See Events.