Getting Started
Android​
1. Add the dependency​
Add the Fedo artifact to your build.gradle.kts:
dependencies {
implementation("com.getfedo:sdk-android:0.3.0")
}
2. Initialize the SDK​
Call Fedo.initialize once, early in your app's startup - typically in Application.onCreate() or your launcher Activity.
import com.fedo.sdk.Fedo
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
Fedo.initialize(applicationContext, apiKey = "...")
}
}
Fedo.initialize must be called before any other SDK method.
3. Set the current user​
Before showing the feedback screen, identify the user:
Fedo.setUserID("user-123") // optional
Fedo.setUserDisplayName("Jane Doe") // optional
Fedo.setUserEmail("jane@example.com") // optional
Fedo.setUserProperty("tier", "gold") // optional
Call setUserID whenever the user changes (login/logout). See User Management for details.
4. Add the feedback screen​
Place FeedbacksScreen() inside your Compose UI hierarchy:
import androidx.compose.runtime.Composable
import com.fedo.sdk.ui.FeedbacksScreen
@Composable
fun MyScreen() {
FeedbacksScreen(
onDismiss = { /* return to previous screen in host app */ }
)
}
That's it. The SDK handles:
- Feedback list with tabs (All / Mine)
- Creating new feedback via FAB
- Tapping a feedback item opens details with comments
- Voting and commenting
- Swipe-to-refresh
5. Build and run​
Run your app. You should see the feedback board rendered inside the composable slot you placed FeedbacksScreen() in.
Troubleshooting​
The screen is blank, or a call throws immediately.
Fedo.initialize must run before any other SDK method. If you initialize in
an Activity rather than Application.onCreate(), a process restart can
land the user on a screen that calls the SDK before initialization has run.
Initializing in Application.onCreate() avoids this.
Feedback appears under a random name.
That is the anonymous user. If setUserID is never called, the SDK creates
an anonymous identity on first open and caches it on the device. Call
setUserID once you know who the user is, and their existing feedback,
comments and votes are migrated onto the authenticated user.
A setUser* call had no effect.
These calls go through an internal queue and are not retried. A failing
operation is skipped and the queue continues with the next one, so a call
that fails is silently lost until you make it again. There is no offline
support yet. Turn on debug in the config to see what the SDK is doing —
output is tagged FedoLogger. See Configuration.
Back navigation exits the whole feature instead of going up a screen.
onDismiss fires only when the user presses back on the root list screen.
Back from the editor or the detail screen is handled inside the composable.
If your app pops its stack on every back press, you are handling navigation
the composable already owns.
setUserID seems to do nothing when called twice.
Calling it with the same ID is a no-op by design.
Next steps​
- Core concepts - the object model behind the API
- Configuration - customize the SDK behaviour
- User Management - user identity and properties
- Feedback Screen - details on the UI component
- UI Configuration - UI configuration