Below are the various processes involved in setting up SpotChecks in UI Kit. Kindly refer example applications
Installation
Open XCode and click on "File" menu
Click on "Add Package Dependency"
Enter the package URL -
Select the version of SDK and Add to App Targets.
Then, click on Add Package to add the SurveySparrowSdk package to your IOS project.
The SurveySparrowSdk package can also be added by navigating to your target's General panel -> In the “Frameworks, Libraries, and Embedded Content” section, click on the + button -> select "Add Other "-> choose "Add Package Dependency" -> Enter the above package URL -> Click on Add Package.
Pre-requisites
Ensure that all the screens are wrapped within the Navigation Controller or Tab Bar Controller
Initialization
Import the SurveySparrowSdk and initialize a variable named spotCheck.
import SurveySparrowSdk
Anonymous users
If you wish not to keep track of users' data, you can follow the below syntax for initialization.
var spotCheck = Spotcheck (
domainName: "<your_domain>",
targetToken: "<target_token>",
userDetails: [:],
variables: [:],
customProperties: [:],
sparrowLang: "ta", // Eg: ta, en
isUIKitApp: true
)
Known Users
If you wish to keep track of users' data and perform conditional Survey triggers, you can follow the below syntax for initialization.
If a survey needs to be triggered when the user completes a payment, then the TrackEvent function should be called with the respective ScreenName and optional custom properties.