AI Integration Quick Reference
AI Integration Quick Reference
- Kotlin
- Java
init(), then listen for online/offline events via UserListener.
Real-time Presence
Based on theAppSettings configured during init(), the logged-in user receives presence updates for other users.
AppSettingsBuilder provides three subscription options:
subscribePresenceForAllUsers()— Receive presence for all users in the app.subscribePresenceForRoles(List<String> roles)— Receive presence only for users with specified roles.subscribePresenceForFriends()— Receive presence only for friends.
UserListener in onResume() and remove it in onPause().
- Java
- Kotlin
| Parameter | Description |
|---|---|
listenerID | An ID that uniquely identifies that listener. We recommend using the activity or fragment name. |
onPause() when the activity or fragment is no longer in use.
- Java
- Kotlin
User List Presence
When you retrieve the list of users, eachUser object includes:
status—"online"or"offline"lastActiveAt— Unix timestamp of when the user was last online (useful for “Last seen” indicators)
Next Steps
Retrieve Users
Fetch user lists with presence information
Connection Status
Monitor SDK connection state and handle reconnection
User Management
Learn about user objects and properties
Real-Time Listeners
Understand all available event listeners