In applications using the Navigation SDK, your users can send feedback on route quality, map data, and the navigation experience including both visual and audio data in turn-by-turn or free-drive mode. This feedback is processed by Mapbox to provide better navigation experiences, route quality, traffic congestion data, map quality, and more. The SDK provides following feedback options:
- Submit feedback: A user can submit feedback while navigating.
- Submit deferred feedback: A user can submit feedback after they've completed a trip about a location they passed during the trip. This is useful if you don't want to ask a user to fill in a feedback form while driving.
To submit user's feedback, invoke
MapboxNavigation#postUserFeedback. It requires:
@FeedbackEvent.Type feedbackType: String: to get feedback's types for
description: String: usually user's comment about an issue;
@FeedbackEvent.Source feedbackSource: String: source of feedback. You should pass
REROUTEparam if a feedback is sent because of unexpected re-route, otherwise it should be
screenshot: String: decoded screenshot to base64. To make screenshot you can use Maps SDK API (
ViewUtils#capture. To decode a screenshot use
feedbackSubType: Array<@FeedbackEvent.SubType String>: each feedback's type might have multiple feedback's subtypes. To get possible feedback subtypes for a feedback's type use
mapboxNavigation.postUserFeedback( feedbackType, description, FeedbackEvent.UI, screenshot, feedbackSubTypes )
Deferred feedback is posted the same way as the feedback described above with one additional field for
feedbackMetadata. This is an object holds metadata of feedback (like location and time).
MapboxNavigation#provideFeedbackMetadataWrapper provides a wrapper of
FeedbackMetadata that is used to accumulate additional data that is attached to feedback (for example it accumulates all locations the user passed after
provideFeedbackMetadataWrapper was called).
You should call this method at a moment when feedback is reported and hold onto the metadata object until the trip finishes (or at other convenient moment), where you can unwrap it and send with additional details provided by the user.
FeedbackMetadata from the wrapper call
FeedbackMetadataWrapper#get. You can serialise and deserialise
FeedbackMetadata to store an object on a device using
FeedbackMetadataWrapper until you need
FeedbackMetadata to give a chance accumulate as much data as possible.
mapboxNavigation.postUserFeedback( feedbackType, description, FeedbackEvent.UI, screenshot, feedbackSubTypes, feedbackMetadata )