In-App Surveys Callbacks
React when a survey is shown or dismissed in your KMP app, using the onShow and onDismiss flows or the simpler main-thread convenience handlers.
Flows
When a survey is shown:
scope.launch {
SurveysKmp.onShow.collect {
// Survey UI is about to be shown
}
}When a survey is dismissed:
scope.launch {
SurveysKmp.onDismiss.collect {
// Survey UI was dismissed
}
}Handlers (convenience)
For simple callbacks on the UI thread, you can use handlers instead of collecting the flows:
SurveysKmp.setOnShowHandler {
// Called before survey UI is presented
}
SurveysKmp.setOnDismissHandler {
// Called after survey UI is dismissed
}For more control (e.g. coroutine context), use the onShow and onDismiss flows.
Last updated