Skip to main content
Skip table of contents

Adding New App Details

Upon installing SDK, you must add your app via the Dropthought mobile app.

Follow the below steps to add a new app:

  1. Navigate to your Profile on the Dropthought mobile app.

  2. Click on Manage Native SDK.

  3. Click on Manage Applications. The section will be empty if you do not have any apps added.

    If you have already added any apps earlier, they will be displayed on this screen.

  4. Click on Browse and upload an app icon.

  5. Enter the App Name and Version Name (optional).

     

  6. Click on Add new visibility.
    In the following screen, you will be prompted to enter the page name and element name that should redirect the user to the linked program.
    This information will help you to easily identify which element (widget, for instance) on your app is connected to a visibility ID. You can edit the page name and element name anytime.

  7. Once you add a page and element name for later reference, click on Add Visibility.
    This will give you a unique ID you must insert in the code snippet to be added to your app. This unique ID cannot be edited as it will be used to uniquely identify the element of your app where Dropthought will collect feedback.

Open Program

Use the following snippet to open the Dropthought survey based on an action performed by a user on your app.
Copy the visibility ID and paste it into the code snippet below, replacing YOUR_VISIBILITY_ID. 

Pre-requisite:
Declare const openSurvey = useOpenSurvey() and use openSurvey whenever you need to open the program.

CODE
import { useOpenSurvey } from '@dropthought/react-native-dt-sdk';

// ...

const onButtonPress = () => {

  // declare this hook

  const openSurvey = useOpenSurvey();

  // survey screen will be open by calling the below method

  openSurvey({

    visibilityId: 'YOUR_VISIBILITY_ID',

  });

};

Set Program Metadata

Use the below APIs to capture metadata from the responses received.

CODE
import { useOpenSurvey } from '@dropthought/react-native-dt-sdk';

// ...

const onButtonPress = () => {

  // declare this hook

  const openSurvey = useOpenSurvey();

  // declare the metadata you desire

  const metadata = { name: 'barney', age: '36' };

  // survey screen will be open by calling the method below

  openSurvey({

    visibilityId: 'YOUR_VISIBILITY_ID',

    metadata: metadata,

  });

};


feedback-img.png

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.