iOS SDK configuration

The following configuration will require a Workspace Key. You can get your workspace key in the Access Keys section of the Survicate panel.

  1. Add workspace key to your Info.plist file.
    • Create Survicate Dictionary.
    • Define WorkspaceKey String in Survicate Dictionary. This is how your Info.plist file should look like: Info.plist example

As an alternative to the main way of specifying the Workspace Key, you can also use the setWorkspaceKey() method.

Important:

  • Using setWorkspaceKey() method overrides the Workspace Key defined in the configuration.
  • setWorkspaceKey() method must be used before init() method is called.
  1. Initialize the SDK using the initialize method. Choose an initialization method described below based on whether your project utilizes 'AppDelegate' class.

Make sure that import Survicate line exists in all classes where you call SDK methods.

Survicate iOS SDK can be used in SwiftUI projects. If your SwiftUI project doesn't use the AppDelegate class, the initialization of the Survicate Mobile SDK can be done in the constructor of the main application class:

Enable debug messaging

To enable debug console messages from the SDK, use the setDebuggable(log:) method with the desired log level. The SDK provides four log levels:

  • .none
  • .error
  • .info
  • .verbose

This is useful for development and debugging purposes. Make sure to disable it (.none) in production builds.