Skip to main content

CustomerJourneyNavigator

MJCS includes the ability to inject custom screens in between journey steps. This is an advanced feature and will require more implementation than most MJCS features. By creating an instance of CustomerJourneyNavigatorComposable and passing it to the the CustomerJourneyActivity.startActivity function (described in quick setup) you can insert additional screens in various phases of MJCS.

data class CustomerJourneyNavigatorComposable(
/**
* Whether a journey should show a prompt to the user confirming that they wish to cancel
* the journey when the user tries to cancel.
*/
var showCancelConfirmationPrompt: Boolean = false,

/**
* If [showCancelConfirmationPrompt] is true, a default "Are you sure you want to cancel
* the journey?" prompt will be shown. An implementor may override that with their own
* cancel prompt by supplying this composable function. The composition should allow a user
* to select whether to cancel the journey or return to the journey.
*/
var cancelConfirmationView: (@Composable (
/**
* true = yes, cancel the journey
* false = no, return to the journey
*/
userResponse: (Boolean) -> Unit
) -> Unit)? = null,

/**
* Allows for overriding processing screens on a per step basis.
*/
var processingViewMap: Map<Action, @Composable (() -> Unit)>? = null,

/**
* Allows for a screen to be shown prior to any step in the journey by providing a map of
* [Action] to Composable functions. This can be used to present additional guidance or
* explanations to the end user. When ready to proceed to the step (usually when the
* user clicks some type of confirm/continue button) invoke proceedToNextStep from within
* the composition.
*/
var prescreenInjectionMap: Map<Action,
@Composable (proceedToNextStep: () -> Unit) -> Unit>? = null
): Serializable