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.
-
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.
-
Install the SDK
In Xcode choose File → Add Package Dependencies…, enter the package URL you received with your access and add the
ResponslySDKproduct to your app target.CocoaPods is covered in iOS installation.
Make
com.responsly:sdkavailable to your build as described in your access details, then add the dependency.app/build.gradle.kts dependencies {implementation("com.responsly:sdk:1.34.0")}More in Android installation.
Make
@responsly/react-native-sdkavailable to your project as described in your access details, then add it.Terminal window npm install @responsly/react-native-sdkcd ios && pod installExpo needs a development build. See React Native installation.
Add
responsly_sdktopubspec.yamlfrom the source given in your access details, then runflutter pub get.More in Flutter installation.
Open Window → Package Manager, click +, choose Add package from git URL… and enter the package URL you received with your access.
The SDK does nothing in the Editor. Build to a device or simulator to see surveys. More in Unity installation.
-
Initialize at app start
Use the SDK key from step 1. Set the
debuglog level for now.import SwiftUIimport ResponslySDK@mainstruct MyApp: App {init() {Responsly.shared.initialize(sdkKey: "rsk_…",options: ResponslyOptions(logLevel: .debug))}var body: some Scene {WindowGroup { ContentView() }}}import android.app.Applicationimport com.responsly.sdk.*class MyApp : Application() {override fun onCreate() {super.onCreate()Responsly.initialize(applicationContext,"rsk_…",ResponslyOptions(logLevel = LogLevel.DEBUG))}}index.js import Responsly from '@responsly/react-native-sdk'Responsly.initialize('rsk_…', { logLevel: 'debug' })lib/main.dart import 'package:flutter/material.dart';import 'package:responsly_sdk/responsly_sdk.dart';Future<void> main() async {WidgetsFlutterBinding.ensureInitialized();await Responsly.initialize('rsk_…',options: const ResponslyOptions(logLevel: ResponslyLogLevel.debug),);runApp(const MyApp());}Assets/Scripts/ResponslyBootstrap.cs using Responsly;using UnityEngine;public static class ResponslyBootstrap{[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]private static void Init(){ResponslySDK.Initialize("rsk_…", new ResponslyOptions { LogLevel = ResponslyLogLevel.Debug });}} -
Identify the user
Call
identifywhen 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_idto the form to store the user ID, and one namedplanto store theplanattribute. See Hidden fields.Responsly.shared.identify(userId: "user-123", traits: ["plan": "pro", "seats": 5])Responsly.identify("user-123", mapOf("plan" to "pro", "seats" to 5))Responsly.identify('user-123', { plan: 'pro', seats: 5 })Responsly.identify('user-123', traits: {'plan': 'pro', 'seats': 5});// using System.Collections.Generic;ResponslySDK.Identify("user-123", new Dictionary<string, object> { { "plan", "pro" }, { "seats", 5 } }); -
Track the event
Call
trackwhere 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])Responsly.track("purchase_completed", mapOf("value" to 49.9))Responsly.track('purchase_completed', { value: 49.9 })Responsly.track('purchase_completed', properties: {'value': 49.9});ResponslySDK.Track("purchase_completed", new Dictionary<string, object> { { "value", 49.9 } });To show the survey from code instead, call
showSurveywith the Survey ID. Withforceit appears regardless of targeting, which is handy for a first test.Responsly.shared.showSurvey("AbCd1234", options: ResponslyShowOptions(force: true))Responsly.showSurvey("AbCd1234", ShowOptions(force = true))Responsly.showSurvey('AbCd1234', { force: true })Responsly.showSurvey('AbCd1234', force: true);ResponslySDK.ShowSurvey("AbCd1234", new ShowOptions { Force = true }); -
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_idhidden field.If nothing appears, read the log. With the
debuglevel the SDK writes one line per decision, prefixed[Responsly], with the survey ID and the reason a survey was not shown.Platform Where to read the log iOS Xcode console, or Console.app filtered by [Responsly]Android Logcat, filtered by ResponslyReact Native, Flutter, Unity The 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) andconfig_unavailable(wrong SDK key or no network). The full list is in Testing & debugging.
Next steps
Section titled “Next steps”- Targeting: who sees a survey and how often.
- Callbacks: react to shown, answered, completed and dismissed.
- Privacy & data: what is stored and what is sent.
- Before release: lower the log level to
errorand read Testing & debugging.