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.
- Add workspace key to your
Info.plistfile.- Create
SurvicateDictionary. - Define
WorkspaceKeyString inSurvicateDictionary. This is how yourInfo.plistfile should look like:
- Create
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 beforeinit()method is called.
- Initialize the SDK using the
initializemethod. 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.