Installation
The SDK can be installed in the iOS mobile app using one of the three methods described below.
- Open Xcode and select New Project in the File > New > Project... menu to create a new project for your application.
- Choose the App template for your project.
- When prompted, choose your app name (e.g., Survabox) and use the default options. Next, select the location to save the project and finally click on the Create button to finish project creation.
- Once the project is created, open your application in Xcode and select your project's Package Dependencies tab.
- Copy the Survicate SDK Swift package
                                repository URL https://github.com/surveybox-io/SurveyBoxSdk-iosinto the search field.
- Under Dependency Rule, select a version according to your preferences.
- The SDK supports iOS 13+.
- Survicate Mobile SDK is distributed in a binary version and developed using Swift 5.3.
- The minimum required version of Xcode is 13.0, however, we recommend using the SDK with Xcode 13.1 and above.
Using Survaybox Mobile SDK requires an account at Survaybox. Sign up for free and find your workspace key in the Access Keys tab.
Installation Steps
- Download the latest Surveybox SDK for iOS and extract the zip file (approximately 1.3MB).
- Open your existing iOS application Xcode project.
- Import the SurvayBox.embeddedframework into your project.
- Confirm the SDK files have been added to your
                                project:- Navigate to your project build settings by selecting your project's Project File in the Project Navigator.
- Select the main build target for your app.
- Select the Build Phases tab.
- Confirm that Thunderhead.xcframeworkis located in the Link Binary With Libraries section.
- Confirm that ThunderheadBundle.bundleis located in the Copy Bundle Resources section.
 
Configuring Framework API Key
To use the framework's features, you need to configure the API key. Follow these steps:
- Open the AppDelegate.swiftfile.
- Locate the didFinishLaunchingWithOptionsmethod.
- Find the line that configures the API key.
- Replace the placeholder YOUR_API_KEYwith your actual API key and your customer email id.
- Save the changes to the AppDelegate.swiftfile.
- Build and run the application.
Example code in AppDelegate.swift:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    // Other code...
    // Configure your API key
    Surveybox.configure(apiKey: "YOUR_API_KEY", customer_email: "Email")
    // Other code...
    return true
}
                        Using Framework's WellcomeVC Class
To use the WellcomeVC class
                            from our framework in your ViewController,
                            follow these steps:
Import the framework at the top of your
                                ViewController
                                or where you want to show the Survey file:
                            
import SurvayNew
Use the following function to present the survey:
func showSurvayBox() {
    let controller = WellcomeVC.createNew(with: "")
    controller.modalPresentationStyle = .fullScreen
    controller.modalPresentationStyle = .overCurrentContext
    self.present(controller, animated: true, completion: nil)
}
                            Ready to Get Started?
Follow the installation steps above to integrate the SurveyBox SDK into your iOS application and start collecting valuable user feedback today.
