Skip to main content

Functions

INIT

The init function allows you to display every survey from your source without coding anything else.

It will automatically search for triggers and display a survey whenever it matches the user’s actions.

let configuration: ToldConfiguration = .init(
sourceId: "__SOURCE_ID__",
applicationId: "__APPLICATION_ID__",
environment: .production,
appVersion: "__APP_VERSION__"
)
Told.init(configuration)

IDENTIFY USERS

This function updates the current user information. Use it when you need to provide information, log in, or update details.

Told.identify(properties: ["name":"toto"])

LANGUAGE

In the editor, you can configure multiple languages. By default, the sdk will detect the user's language. If the language differs from the one set up in your application, it will revert to the default language. To customize these settings, simply include the key "language" along with its corresponding value in the identify.

Told.identify(properties: ["language":"en"])

TRACK EVENT

Allows you to send custom events.

Told.trackEvent(eventName: String, properties: [String: AnyHashable])

ACTIVATE AUTOMATIC SCREEN

Activate automatic screen tracking with swizzling on the UIViewController/viewDidAppear(_:) method

SwiftUI controllers are skipped

Told.activateAutomaticScreenTracking()

DEACTIVATE AUTOMATIC SCREEN

Deactivate automatic screen tracking

Told.deactivateAutomaticScreenTracking()

TRACK CHANGE PAGE

Allows you to send the current page/view.

Told.trackChangePage(_ pageName: String)

START

Start a survey with the provided surveyId

Told.start(surveyId: String, delay: TimeInterval = 0)

RESET

Upon logout, the user's data should be reset to make them an anonymous person again.

Told.reset()

DEBUG WIDGET

Log information about your source and your surveys.

It will be displayed with the info log level

Told.debugWidget()