Skip to main content

Callbacks and Delegates

FSOnReadyListener

FSOnReadyListener can be used to get a callback when a session has started or resumed. This is useful for getting the current session ID or session URL as FS.getCurrentSession and FS.getCurrentSessionURL will return null when there is no active session.

The listener can be set with FS.setReadyListener (or removed by passing in null).

MethodDescription
onReady(FSSessionData sessionData)Called when the session has initialized and will begin or resume capturing.

FSStatusListener

Since 1.47
FSStatusListener can be used to get callbacks for a greater variety of events including disabled session status and SDK errors.

Status listeners can be registered and unregistered with FS.registerStatusListener and FS.unregisterStatusListener respectively. Unlike FSOnReadyListeners, you can have multiple FSStatusListeners registered concurrently.

MethodDescription
onSession(FSSessionData sessionData)Called when the session has initialized and will begin or resume capturing. This is equivalent to FSOnReadyListener#onReady.
onSessionDisabled(FSReason reason)Called when initialization has completed but FS will not begin capturing due to the session being disabled.
onFSError(FSReason error)Called when the SDK encounters an unrecoverable error and will cease or not begin to attempt capturing.
onFSDisabled(FSReason reason)Called when the SDK is disabled. This may be due to an incompatible device or OS version or due to FS not being instrumented.

For convenience, a DefaultFSStatusListener is provided that has empty implementations of each callback method in the interface that you may extend and only have to implement the callbacks you are interested in.

Additional Information