Skip to content

Iterate

msingleton edited this page Jan 16, 2023 · 18 revisions

Iterate

The Iterate class is the primary class of the SDK, the main entry point is the shared singleton property

public final class Iterate 

Properties

shared

The shared singleton instance is the primary entrypoint into the Iterate iOS SDK. Unless you have uncommon needs you should use this singleton to call methods on the Iterate class.

public static let shared 

PreviewParameter

Query parameter used to set the preview mode

public static let PreviewParameter = "iterate_preview"

DefaultAPIHost

Default API host

public static let DefaultAPIHost = "https://iteratehq.com"

Methods

sendEvent(name:complete:)

Send event to determine if a survey should be shown

public func sendEvent(name: String, complete: ((Survey?, Error?) -> Void)? = nil) 

Parameters

  • name: Event name
  • complete: optional callback with the results of the request

configure(apiKey:apiHost:surveyTextFontName:buttonFontName:)

Configure sets the necessary configuration properties. This should be called before any other methods.

public func configure(apiKey: String, apiHost: String? = Iterate.DefaultAPIHost, surveyTextFontName: String? = nil, buttonFontName: String? = nil) 

Parameters

  • apiKey: Your Iterate API Key, you can find this on your settings page

preview(url:)

Preview processes the custom scheme url that was used to open the app and sets the preview mode to the surveyId passed in

public func preview(url: URL) 

Parameters

  • url: The URL that opened the application

preview(surveyId:)

Preview a specific survey using it's id

public func preview(surveyId: String) 

Parameters

  • surveyId: The id of the survey to preview

identify(userProperties:)

public func identify(userProperties: UserProperties?) 

identify(responseProperties:)

public func identify(responseProperties: ResponseProperties?) 

reset()

public func reset()