FeedbackComposer

fun FeedbackComposer(client: FeedbackClient, userToken: String? = null, initialDraft: FeedbackDraft? = null, onSubmit: (FeedbackSubmissionResult) -> Unit = {}, onPickAttachment: () -> Unit? = null, modifier: Modifier = Modifier)(source)

Ready-made User Feedback Submission Form composable.

Provides a streamlined interface for collecting user feedback, issue reports, diagnostic attachments, and contact info. Includes title input, multiline description, optional reporter name/email fields, attachment picker with upload support, validation indicators, and a confirmation state.

Behavior & Input Validation

  • Pre-filled App Version Info: When initialDraft is omitted, automatically extracts versionName and versionCode from android.content.pm.PackageManager so users don't need to specify them.

  • Attachments & PhotoPicker: Includes built-in system PhotoPicker integration or custom onPickAttachment callback to upload screenshots and logs via FeedbackClient.uploadAttachment.

  • Character Validation: Submit button remains disabled until the title contains at least 3 non-whitespace characters and the description contains at least 5 characters.

  • Success Confirmation View: Upon successful delivery via FeedbackClient.submit, displays a confirmation card thanking the user, rendering any server warnings, and offering a "Send More" button.

  • Callback Handling: onSubmit is invoked with the FeedbackSubmissionResult, allowing the host app to trigger navigation (e.g. popping the back stack) or custom analytics.

  • Remote Theming & Feature Gating: Automatically wrapped in SdkSurface with SdkFeature.FEEDBACK.

Example Integration

@Composable
fun FeedbackNavigationDestination(
client: FeedbackClient,
userTokenStore: UserTokenStore,
onNavigateBack: () -> Unit
) {
FeedbackComposer(
client = client,
userToken = userTokenStore.token,
onSubmit = { result ->
Log.d("Feedback", "Sent: ${result.submissionId}")
onNavigateBack()
},
modifier = Modifier.fillMaxSize()
)
}

Screenshot

Feedback Composer

Parameters

client

Shared FeedbackClient instance used to submit feedback and upload attachments.

userToken

Optional stable anonymous token from UserTokenStore, sent as the X-User-Token header.

initialDraft

Optional pre-populated FeedbackDraft; defaults to an auto-filled draft for the current package.

onSubmit

Callback invoked with the FeedbackSubmissionResult upon successful submission.

onPickAttachment

Optional callback to override image attachment selection; if null, uses system PhotoPicker.

modifier

Optional Modifier applied to the root Scaffold layout.