Create and Show a Survey

Prev Next
  1. Create a Survey Object

    private lateinit var surveyView: XeboSurveyView
  2. Initialization and Performance (optional)

    Call preWarmSurvey early (e.g., in Application.onCreate or Activity.onCreate) to ensure surveys load instantly.

    XeboSurveyView.preWarmSurvey(this)
  3. Initialize the Survey object

    surveyView = XeboSurveyView(this)
  4. Load a full screen survey

    // parent: FragmentActivity
    // delegate: XeboSurveyDelegate
    // surveyURL: String? (survey URL)
    surveyView.loadFullscreenSurvey(this, this, surveyUrl)
  5. Load survey after N number of visits

    // visits: Int
    // parent: FragmentActivity
    // delegate: XeboSurveyDelegate
    // surveyURL: String? (survey URL)
    surveyView.loadSurveyAfter(N, this, this, surveyUrl)
  6. Load the survey with Lowest response

    // List of survey UUIDs
    val surveyUUIDs = listOf(
        "uuid1",
        "uuid2",....
    )
    
    // Xebo API key
    val apiKey = "YOUR_XEBO_API_KEY"
    
    // Load the survey with the lowest response count
    surveyView.loadLowestResponseSurvey(
        parent = this,          // FragmentActivity
        delegate = this,        // XeboSurveyDelegate
        surveyUUIDs = surveyUUIDs,
        apiKey = apiKey
    )