Bubbl notifications can contain survey questions. The host app renders these in a modal.
- A dynamic survey UI built from Bubbl’s question schema.
- Answer collection and submission to Bubbl.
ModalFragmentparses questions and builds views.- Layouts live in
/Users/jackwright/Projects/Bubbl/bubbl-internal-android-host-app/app/src/main/res/layout/survey_*.
- Read questions from
NotificationRouter.DomainNotification. - Collect answers into
SurveyAnswerobjects. - Call the SDK to submit.
val answers = mutableListOf<SurveyAnswer>()
// Build answers by reading your custom UI fields
BubblSdk.submitSurvey(
notificationId = notification.id.toString(),
locationId = notification.locationId,
answers = answers
) { success ->
if (success) {
Toast.makeText(context, "Thanks!", Toast.LENGTH_SHORT).show()
}
}Tooltip
If you don’t need surveys, you can skip all survey code and simply render media or CTAs.