-
Notifications
You must be signed in to change notification settings - Fork 9
Iterate
The Iterate class is the primary class of the SDK, the main entry point is the shared singleton property
public final class Iterate
Initializer
init(storage: StorageEngine = Storage.shared)
- storage: - storage: Storage engine to use
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.
let shared
Query parameter used to set the preview mode
let PreviewParameter
let Version
Default API host
let DefaultAPIHost
URL Scheme of the app, used for previewing surveys
var urlScheme
API Client, which will be initialized when the API key is
var api: APIClient?
Optional API host override to use when creating the API client
var apiHost: String?
The id of the survey being previewed
var previewingSurveyId: String?
Storage engine for storing user data like their API key and user attributes
var storage: StorageEngine
Container manages the overlay window
let container
var bundle: Bundle?
You Iterate API Key, you can get this from your settings page
var companyApiKey: String?
The API key for a user, this is returned by the server the first time a request is made by a new user
var userApiKey: String?
var userProperties: UserProperties?
var responseProperties: ResponseProperties?
Send event to determine if a survey should be shown
public func sendEvent(name: String, complete: ((Survey?, Error?) -> Void)? = nil)
- name: - name: Event name
- complete: - complete: optional callback with the results of the request
Configure sets the necessary configuration properties. This should be called before any other methods.
public func configure(apiKey: String, apiHost: String? = Iterate.DefaultAPIHost)
- apiKey: - apiKey: Your Iterate API Key, you can find this on your settings page
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)
- url: - url: The URL that opened the application
Preview a specific survey using it's id
public func preview(surveyId: String)
- surveyId: - surveyId: The id of the survey to preview
public func identify(userProperties: UserProperties?)
public func identify(responseProperties: ResponseProperties?)
Helper method used when calling the embed endpoint which is responsible for updating the user API key if a new one is returned
private func embedRequest(context: EmbedContext, complete: @escaping (EmbedResponse?, Error?) -> Void)
- context: - context: Embed context data
- complete: - complete: Callback returning the response and error from the embed endpoint
Update the API client to use the latest API key. We prefer to use the user API key and fall back to the company key
private func updateApiKey()
Generated at 2023-09-20T16:41:01+0000 using swift-doc 1.0.0-rc.1.