Ir al contenido

API Reference

Esta página resume los entry points públicos visibles en el código Kotlin compartido.

Responsabilidades principales:

  • inicializar el runtime del SDK
  • cargar las definiciones de popup
  • adjuntar un contexto de plataforma
  • evaluar triggers y encolar popups
  • renderizar las experiencias de popup y encuesta
  • emitir eventos de ciclo de vida del popup
  • init(options: InitOptions)
  • initialize(options: InitOptions)
  • autoLaunch()
  • attachContext(context: PlatformContext)
  • setPath(path: String?)
  • onScroll(percentage: Int)
  • onExit()
  • triggerEvent(eventName: String)
  • triggerClick(targetId: String)
  • show(options: ShowOptions, context: PlatformContext)
  • showByPopupId(popupId: String, context: PlatformContext)
  • triggerSurvey(surveyId: String, context: PlatformContext, popupId: String? = null)
  • on(event: Event, listener: (EventData) -> Unit)
  • off(event: Event, listener: (EventData) -> Unit)
  • environment: Environment — de solo lectura, refleja el backend al que apunta el SDK tras init() (por defecto Environment.Production). Útil para afirmar en tiempo de ejecución qué backend está usando un publicKey dado.

El objeto Deepdots ofrece helpers de utilidad:

  • create()
  • createInitialized(options)
  • now()
  • parseHtml(html)
  • dismiss(context)
  • getSurveyHtml(surveyId, productId)
  • createInitializedSimple(...)

El repositorio también ofrece helpers de scroll en Android:

  • bindRecyclerView(recyclerView: RecyclerView)
  • bindScrollView(scrollView: ScrollView)

Ayudan a traducir el scroll del host en actualizaciones de onScroll(...) para la evaluación de triggers.