User Management
Call user methods on the Fedo singleton. We recommend calling them after Fedo.initialize so the SDK can route them correctly. Before initialization they are silent no-ops on both platforms — the calls are simply discarded.
The identity API is the same on both platforms:
- Kotlin
- Swift
Fedo.setUserID("user-abc-123")
Fedo.setUserDisplayName("Jane Doe")
Fedo.setUserEmail("jane@example.com")
Fedo.setUserProperty("plan", "enterprise")
Fedo.logout()
Fedo.setUserID("user-abc-123")
Fedo.setUserDisplayName("Jane Doe")
Fedo.setUserEmail("jane@example.com")
Fedo.setUserProperty("plan", value: "enterprise")
Fedo.logout()
Anonymous User​
If setUserID is not called, and the Feedback UI is opened (via FedoFeedbackScreen() / FedoCreateFeedbackSheet() on Android, or FedoFeedbackView() / .presentFedoCreateFeedback(isPresented:) on iOS), anonymous user will
be created with random id, and cached. So, next app session will keep using the same anonymous id created before.
Once the user authenticates to your app, you can call setUserID and all interactions (feedbacks created, comments, votes) done by the anonymous user will be migrated to the newly authenticated user. Then the anonymous user is permanently deleted.
Data migration only happens when moving from anonymous user to authenticated user
Methods:​
All methods below can be called synchronously. An internal queue will handle calling them one by one in the right order. A failing operation is skipped and the queue continues with the next one.
Currently there is no retry or offline support. If any of these calls fails, it will not be retried automatically — you must call it again. Offline support is planned for a future version.
setUserID​
We recommend against calling setUserID for anonymous visitors to your app.
Call setUserID when you know the identity of the current user, passing in their user ID as an argument. This is typically at account registration and at log in.
Calling setUserID with the same id is a no-op.
- Kotlin
- Swift
Fedo.setUserID("user-abc-123")
Fedo.setUserID("user-abc-123")
setUserDisplayName​
Display name shown on feedback and comments created by this user.
- Kotlin
- Swift
Fedo.setUserDisplayName("Jane Doe")
Fedo.setUserDisplayName("Jane Doe")
setUserEmail​
- Kotlin
- Swift
Fedo.setUserEmail("jane@example.com")
Fedo.setUserEmail("jane@example.com")
setUserProperty​
Attach custom key-value metadata to the user (e.g. plan tier, team, beta cohort).
- Kotlin
- Swift
Fedo.setUserProperty("plan", "enterprise")
Fedo.setUserProperty("team", "design")
Fedo.setUserProperty("plan", value: "enterprise")
Fedo.setUserProperty("team", value: "design")
Applying the same key again will override previous assignments.
- Kotlin
- Swift
Fedo.setUserProperty("tier", "gold")
Fedo.setUserProperty("tier", "silver") // overrides the line before
Fedo.setUserProperty("tier", value: "gold")
Fedo.setUserProperty("tier", value: "silver") // overrides the line before
Predefined User Properties​
The SDK automatically attaches device information to each user. These properties are collected during initialization and updated on each app session.
| Property | Type | Android | iOS | Description |
|---|---|---|---|---|
_platform | String | ✅ | ✅ | Platform name (Android/iOS) |
_manufacturer | String | ✅ | ✅ | Device manufacturer |
_brand | String | ✅ | — | Device brand |
_model | String | ✅ | ✅ | Device model |
_device | String | ✅ | ✅ | Device name |
_osVersion | String | ✅ | ✅ | OS version string |
_sdkVersion | String | ✅ | ✅ | Fedo SDK version |
_locale | String | ✅ | ✅ | User locale |
_timeZone | String | ✅ | ✅ | Device timezone |
_appVersionName | String | ✅ | ✅ | App version name |
_appVersionCode | Long | ✅ | — | App version code |
_appBuild | String | — | ✅ | App build number (CFBundleVersion) |
These properties are automatically collected and cannot be disabled.
logout​
Logs out the currently authenticated user, clear all user cached data (token, ID, name, email, properties), then immediately creates a new anonymous user. If the current user is anonymous, nothing happens.
- Kotlin
- Swift
Fedo.logout()
Fedo.logout()