Skip to content

Quick start

You need a Responsly form, an app you can run on a device or simulator, and access to the SDK package for your platform.

  1. Turn on the Mobile app channel

    Open the form in Responsly, go to Share and select the Mobile app tab.

    • Switch the channel on.
    • Add a trigger of type Event with the name purchase_completed.
    • Leave the other settings at their defaults and save.
    • Copy the SDK key (rsk_…) and the Survey ID.

    No Mobile app tab? The Mobile SDK is switched on per team. See Get access.

  2. Install the SDK

    In Xcode choose File → Add Package Dependencies…, enter the package URL you received with your access and add the ResponslySDK product to your app target.

    CocoaPods is covered in iOS installation.

  3. Initialize at app start

    Use the SDK key from step 1. Set the debug log level for now.

    import SwiftUI
    import ResponslySDK
    @main
    struct MyApp: App {
    init() {
    Responsly.shared.initialize(
    sdkKey: "rsk_…",
    options: ResponslyOptions(logLevel: .debug)
    )
    }
    var body: some Scene {
    WindowGroup { ContentView() }
    }
    }
  4. Identify the user

    Call identify when you know who the user is, for example after login. The user ID and attributes are kept on the device and used for targeting.

    They are saved with the response through the form’s hidden fields: add a hidden field named user_id to the form to store the user ID, and one named plan to store the plan attribute. See Hidden fields.

    Responsly.shared.identify(userId: "user-123", traits: ["plan": "pro", "seats": 5])
  5. Track the event

    Call track where the event happens in your app. The name must match the trigger from step 1 exactly, including case.

    Responsly.shared.track("purchase_completed", properties: ["value": 49.9])

    To show the survey from code instead, call showSurvey with the Survey ID. With force it appears regardless of targeting, which is handy for a first test.

    Responsly.shared.showSurvey("AbCd1234", options: ResponslyShowOptions(force: true))
  6. Run the app and verify

    Trigger the event. The survey opens as a bottom sheet. Answer it and open the form’s results in Responsly: the response is there, with the platform, app version and trigger recorded, and the user ID if the form has a user_id hidden field.

    If nothing appears, read the log. With the debug level the SDK writes one line per decision, prefixed [Responsly], with the survey ID and the reason a survey was not shown.

    PlatformWhere to read the log
    iOSXcode console, or Console.app filtered by [Responsly]
    AndroidLogcat, filtered by Responsly
    React Native, Flutter, UnityThe same native logs: Xcode console on iOS, Logcat on Android

    The most common reasons on a first run are survey_not_found (the channel is off or the Survey ID is wrong) and config_unavailable (wrong SDK key or no network). The full list is in Testing & debugging.