Skip to main content
The surveys module lets you collect user feedback through in-app surveys. Surveys can trigger automatically based on events or be presented manually.

Present a Survey Manually

const presented = await AppDNA.surveys.present("nps_q1_2026");

if (!presented) {
  console.log("Survey not found or already completed");
}

Module Access

const surveys = AppDNA.surveys;

Module Methods

MethodSignatureDescription
presentpresent(surveyId: string): Promise<boolean>Present a survey manually
promptReviewpromptReview(): Promise<void>Start the smart review prompting flow

8 Question Types

TypeDisplayResponse
nps0-10 numeric scaleInteger 0-10
csat1-5 satisfaction scaleInteger 1-5
ratingStar ratingInteger 1-5
emoji_scaleEmoji optionsSelected emoji value
yes_noBinary choiceBoolean
single_choiceRadio button optionsSelected option string
multi_choiceCheckbox optionsArray of selected strings
free_textText input fieldFree-form string

Smart Review Prompting

A two-step flow that routes happy users to the native store review dialog and unhappy users to a feedback form:
  1. In-app question: “Do you enjoy using [app]?”
  2. Positive — shows App Store / Play Store review dialog
  3. Negative — shows a free-text feedback form
await AppDNA.surveys.promptReview();
Rate-limited: maximum 3 times per year, at least 90 days apart. The SDK enforces these limits automatically.

Event Listeners

const unsubPresented = AppDNA.surveys.onPresented((surveyId: string) => {
  console.log(`Survey shown: ${surveyId}`);
});

const unsubResponse = AppDNA.surveys.onResponseSubmitted(
  (surveyId: string, responses: SurveyAnswer[]) => {
    for (const answer of responses) {
      if (answer.question_type === "nps") {
        const score = answer.numeric_value ?? 0;
        if (score >= 9) showReferralPrompt();
        else if (score <= 6) showSupportLink();
      }
    }
  }
);

const unsubDismissed = AppDNA.surveys.onDismissed((surveyId: string) => {
  console.log(`Survey dismissed: ${surveyId}`);
});

// Clean up
unsubPresented();
unsubResponse();
unsubDismissed();

SurveyAnswer

PropertyTypeDescription
question_idstringIdentifier for the question
question_typestringQuestion type
string_valuestring | nullText response
numeric_valuenumber | nullNumeric response
array_valuestring[] | nullMulti-select response
bool_valueboolean | nullBoolean response

Auto-Tracked Events

EventTrigger
survey_presentedA survey is displayed
survey_response_submittedUser submits a survey response
survey_dismissedSurvey is closed without completing

Full Example

import { AppDNA, SurveyAnswer } from "@appdna/react-native-sdk";
import React, { useEffect } from "react";
import { Button } from "react-native";

function FeedbackScreen() {
  useEffect(() => {
    const unsubResponse = AppDNA.surveys.onResponseSubmitted(
      (surveyId: string, responses: SurveyAnswer[]) => {
        const nps = responses.find((a) => a.question_type === "nps");
        const score = nps?.numeric_value ?? 0;

        if (score >= 9) showReferralPrompt();
        else if (score <= 6) showSupportLink();
      }
    );

    return () => unsubResponse();
  }, []);

  async function askForFeedback() {
    await AppDNA.surveys.present("nps_q1_2026");
  }

  async function promptForReview() {
    await AppDNA.surveys.promptReview();
  }

  return (
    <>
      <Button title="Give Feedback" onPress={askForFeedback} />
      <Button title="Rate Us" onPress={promptForReview} />
    </>
  );
}
Surveys are created in the Console under Feedback > Surveys. Trigger-based surveys appear automatically — use present() for precise control over timing.