Skip to content

SdkDialog

Hudson_BuildService edited this page Jan 9, 2026 · 1 revision

SdkDialog is the layout component in the SDK's UI library. It automatically handles:

  • Survey lifecycle management
  • Page navigation (forward/backward)
  • Question rendering
  • Error states
  • Completion states
  • Keyboard management
  • Dialog presentation and dismissal

This is the recommended component for most use cases as it requires minimal setup and handles all survey interactions out of the box.

Appearance

Basic Usage

Android

import com.confirmit.mobilesdk.components.dialogs.SdkDialog
import com.confirmit.mobilesdk.components.dialogs.SdkDialogOption
import com.confirmit.mobilesdk.ui.SurveyFrameConfig
import androidx.fragment.app.Fragment
import android.graphics.Color

class MySurveyFragment : Fragment(), ProgramCallback {
    
    override fun onSurveyStart(config: SurveyFrameConfig) {
        // Basic usage with default color
        val options = SdkDialogOption()
        SdkDialog(config, options).openDialog(parentFragment)
        
        // With custom theme color
        val customOptions = SdkDialogOption(themeColor = Color.RED)
        SdkDialog(config, customOptions).openDialog(parentFragment)
    }
}

iOS

import ConfirmitMobileSDK
import UIKit

class ViewController: UIViewController, ProgramCallback {
    
    func onSurveyStart(config: SurveyFrameConfig) {
        if let controller = getTriggerController() {
            // Basic usage with default color
            let options = SdkDialogOption()
            _ = SdkDialog(config: config, options: options).openDialog(controller: controller)
            
            // With custom theme color
            let customOptions = SdkDialogOption(themeColor: .systemRed)
            _ = SdkDialog(config: config, options: customOptions).openDialog(controller: controller)
        }
    }
}

Properties

Property Type (Android / iOS) Description
config SurveyFrameConfig Survey configuration containing program key, survey ID, and scenario
options SdkDialogOption Dialog options including theme color configuration

SdkDialogOption

Property Type (Android / iOS) Description
themeColor @ColorInt Int / UIColor Theme color for interactive elements

Methods

openDialog

Opens the dialog and presents the survey.

Android

fun openDialog(parentFragment: Fragment): SdkDialog

Parameters:

  • parentFragment: The parent fragment that will host the dialog

Returns: The SdkDialog instance

iOS

func openDialog(controller: UIViewController) -> SdkDialog

Parameters:

  • controller: The parent view controller that will present the dialog

Returns: The SdkDialog instance

Clone this wiki locally