Skip to Content

Events

val registration = OneSygnal.on("survey:shown") { surveyId -> Log.d("MyApp", "Survey shown: $surveyId") } // unsubscribe: registration.cancel()

on() returns a Registration synchronously — there’s no “SDK not ready yet” case to handle like Web’s loader; you can register listeners before initialize() is ever called. There’s no off() on Android — Registration.cancel() is the only unsubscribe mechanism.

Event names and payloads

EventPayloadNotes
readynullFires once, when initialize()’s background work (config, user, surveys, rules engine) has fully settled successfully — the same moment its completion resolves true.
survey:shownString (survey ID)Not an object — a bare survey ID string. Fires once the overlay window is confirmed attached.
survey:completedString (survey ID)Bare string, same as above.
survey:dismissedString (survey ID)Bare string. Also fires when a survey is suppressed for showing an unsupported question type.
survey:question_answeredMap<String, Any?>{ surveyId, questionId }The one event whose payload is an object, not a bare string.

Web’s equivalents (survey:shown/completed/dismissed) all carry an object payload ({ surveyId }) — Android’s are bare strings. Don’t assume the shape is the same across platforms if you’re sharing analytics-forwarding code between them.

ready’s replay latch

If a listener registers for "ready" after it has already fired (e.g. you call on() later in your app’s lifecycle, past initialize()’s completion), it still gets invoked immediately with null — a readyEmitted flag is checked at registration time. This is why ready is safe to listen for from anywhere, not just right after calling initialize().

What’s absent on Android

There is no survey:step on Android — that’s Web’s name for what Android calls survey:question_answered, with a narrower payload (Web’s version also includes a step index; Android’s doesn’t). Deferred rather than unified, since renaming either breaks existing integrators on that platform. See Platform Parity.