iOS installation
Requirements
Section titled “Requirements”- iOS 15 or later
- Xcode 15 or later (Swift 5.9)
- Swift Package Manager or CocoaPods
- The team’s SDK key (
rsk_…) from the form’s Share → Mobile app tab
The module is ResponslySDK. It has no third-party dependencies. App extensions are not supported: a survey needs an app window.
Install
Section titled “Install”The steps use the package URL you received with your access. It is written as <package URL> below.
In Xcode:
- Choose File → Add Package Dependencies…
- Enter the package URL.
- Set the dependency rule to Up to Next Major Version from
1.34.0. - Add the
ResponslySDKproduct to your app target.
Or in Package.swift:
dependencies: [ .package(url: "<package URL>", from: "1.34.0"),],targets: [ .target( name: "MyApp", dependencies: [ .product(name: "ResponslySDK", package: "responsly-ios-sdk"), ] ),]The pod is installed from the package URL. It is not published to CocoaPods trunk, so the :git and :tag parts are required.
platform :ios, '15.0'
target 'MyApp' do pod 'ResponslySDK', :git => '<package URL>', :tag => '1.34.0'endpod installInitialize
Section titled “Initialize”Call initialize once, as early as possible. Calls made before it (identify, track, screen and the rest) are remembered and applied when the SDK starts.
import SwiftUIimport ResponslySDK
@mainstruct MyApp: App { init() { #if DEBUG let options = ResponslyOptions(logLevel: .debug) #else let options = ResponslyOptions(logLevel: .error) #endif Responsly.shared.initialize(sdkKey: "rsk_…", options: options) }
var body: some Scene { WindowGroup { ContentView() } }}import UIKitimport ResponslySDK
@mainclass AppDelegate: UIResponder, UIApplicationDelegate { func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { #if DEBUG let options = ResponslyOptions(logLevel: .debug) #else let options = ResponslyOptions(logLevel: .error) #endif Responsly.shared.initialize(sdkKey: "rsk_…", options: options) return true }}initialize is idempotent for the same key. Calling it with a different key resets the SDK’s local state first.
Options
Section titled “Options”ResponslyOptions has two fields. Both have defaults, and options itself can be left out: Responsly.shared.initialize(sdkKey: "rsk_…").
| Field | Values | Notes |
|---|---|---|
logLevel | .none, .error, .info, .debug | Defaults to .error. Use .debug while integrating. See Testing & debugging. |
apiHost | URL | Defaults to https://api.responsly.com. Leave it unset unless Responsly support gives you another host. |
What you do not need to do
Section titled “What you do not need to do”- Pass a view controller. The SDK presents surveys above the app’s current top view controller by itself.
- Add permissions. The SDK asks for none and uses no advertising identifier. The one exception is described below.
- Write a privacy manifest for the SDK. It ships its own
PrivacyInfo.xcprivacy. See Privacy & data.
Photo and video questions
Section titled “Photo and video questions”File upload questions work without setup. If a survey lets respondents take a photo or record a video, the app’s Info.plist needs the usual camera keys, as for any camera use on iOS:
<key>NSCameraUsageDescription</key><string>Lets you attach a photo to your answer.</string><key>NSMicrophoneUsageDescription</key><string>Lets you record a video for your answer.</string>NSMicrophoneUsageDescription is needed only for video.
Check the installation
Section titled “Check the installation”print(Responsly.sdkVersion) // "1.34.0"Run the app with the .debug log level and look for lines prefixed [Responsly] in the Xcode console.