Feedback
All content on this page refers to the Navigation UI SDK.
Applications using the Navigation UI SDK allow your users to send feedback on route quality, map updates, and the turn-by-turn experience (based both on visual and audio data). This feedback is processed by Mapbox to provide better turn-by-turn guidance experiences, route quality, traffic congestion data, map quality, and more. There are two different ways you can enable this feature to allow your users to provide the feedback:
- One Tap interaction: allows user to send high level feedback.
- Two Tap interaction: allows user to send more detailed level feedback.
To show FeedbackBottomSheet
in your Activity/Fragment
, add the following component to you xml file.
<com.mapbox.navigation.ui.FeedbackButton
android:id="@+id/feedbackButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
When a user taps on the FeedbackButton
, you can choose to show them either the One Tap or Two Tap feedback interaction mechanisms.
One Tap interaction
To enable One Tap interaction, you would have to do the following in your Activity/Fragment
:
if (getSupportFragmentManager() != null) {
FeedbackBottomSheet.newInstance(
new FeedbackBottomSheetListener() {
@Override public void onFeedbackSelected(FeedbackItem feedbackItem) {
// handle events when feedback is selected
}
@Override public void onFeedbackDismissed() {
// handle events when feedback is dismissed
}
},
FeedbackBottomSheet.FEEDBACK_MAIN_FLOW,
0L // Since this is not used in 1 tap interaction, its ok to pass 0L
).show(getSupportFragmentManager(), FeedbackBottomSheet.TAG)
}
supportFragmentManager.let {
FeedbackBottomSheet.newInstance(
object : FeedbackBottomSheetListener {
override fun onFeedbackSelected(feedbackItem: FeedbackItem?) {
// handle events when feedback is selected
}
override fun onFeedbackDismissed() {
// handle events when feedback is dismissed
}
},
FeedbackBottomSheet.FEEDBACK_MAIN_FLOW,
2000L // FeedbackBottomSheet duration in Long
).show(it, FeedbackBottomSheet.TAG)
}
The One Tap UI allows a user to submit any of the following feedback:
- Incorrect visual
- Confusing audio
- Positioning issue
- Route quality
- Illegal route
- Road closure
Two Tap Interaction
Two Tap interaction works similarly to One Tap interaction, but Two Tap allows the user to go one step deeper to submit more details about the issue. To enable Two Tap interaction, the call to newInstance
remains the same, but you will use the FEEDBACK_DETAIL_FLOW
FeedbackFlowType
instead of FEEDBACK_MAIN_FLOW
.
if (getSupportFragmentManager() != null) {
FeedbackBottomSheet.newInstance(
new FeedbackBottomSheetListener() {
@Override public void onFeedbackSelected(FeedbackItem feedbackItem) {
// handle events when feedback is selected
}
@Override public void onFeedbackDismissed() {
// handle events when feedback is dismissed
}
},
FeedbackBottomSheet.FEEDBACK_DETAIL_FLOW,
2000L // FeedbackBottomSheet duration in Long
).show(getSupportFragmentManager(), FeedbackBottomSheet.TAG)
}
supportFragmentManager.let {
FeedbackBottomSheet.newInstance(
object : FeedbackBottomSheetListener {
override fun onFeedbackSelected(feedbackItem: FeedbackItem?) {
// handle events when feedback is selected
}
override fun onFeedbackDismissed() {
// handle events when feedback is dismissed
}
},
FeedbackBottomSheet.FEEDBACK_DETAIL_FLOW,
2000L // FeedbackBottomSheet duration in Long
).show(it, FeedbackBottomSheet.TAG)
}
Two Tap UI allows a user to submit any of the following feedback including specific details:
- Incorrect visual
- Confusing audio
- Positioning issue
- Route quality
- Illegal route
- Road closure
Submit feedback
To submit One or Two Tap feedback:
@Override public void onFeedbackSelected(FeedbackItem feedbackItem) {
MapboxNavigation.postUserFeedback(
feedbackItem.feedbackType,
feedbackItem.description,
FeedbackEvent.UI,
null,
feedbackItem.feedbackSubType.toTypedArray()
)
}
override fun onFeedbackSelected(feedbackItem: FeedbackItem?) {
MapboxNavigation.postUserFeedback(
feedbackItem.feedbackType,
feedbackItem.description,
FeedbackEvent.UI,
null,
feedbackItem.feedbackSubType.toTypedArray()
)
}