The minimum iOS version required is 15.0
Xcode 16.1 and above
Supported Swift versions 4.2, 5.0, 6.0
The SDK is available on the Swift Package Manager. To link the SDK to your app, simply follow steps below
Open your project in Xcode.
Go to File > Add Packages.
Paste the SDK’s GitHub URL -> https://github.com/surveyanalyticscorp/ios-cx.
Click Add Package.
Once downloaded, XCode will ask you to link this package to your app, make sure to choose the latest version(2.0.0)
select the appropriate target and click Add Package.
The SDK initialisation should be done in the AppDelegate or SceneDelegate of the application. To configure the
QuestionPro SDK into your application, use the code below.
Import QuestionProCXFramework into your application’s AppDelegate or SceneDelegate.
let touchPoint = touchPoint.initTouchPoint(TouchPoint.DataCenter.DATA_CENTER_US);
QuestionProCXFramework.configure(
apiKey: apiKey,
touchPoint: touchPoint,
withWindow: window,
callbackDelegate: self);
Extend the callback delegate named 'QuestionProDelegate' and implement the below callback functions:
func initSDKSuccess(){
// SDK successfully initialized
}
func initSDKFailed(error: any Error){
//Return the error if the SDK failed to initialize
}
func getSurveyURL(surveyURL: String){
//Host app can use this survey url
}
Reset the SDK in the AppDelegate or SceneDelegate class. (you should add the clearSession() in the
applicationWillTerminate method)
func applicationWillTerminate(_ application: UIApplication) {
QuestionProCXFramework.clearSession()
}