Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including @survicate/react-native-survicate with all npm packages installed. Try it out:

require("react/package.json"); // react is a peer dependency. require("react-native/package.json"); // react-native is a peer dependency. var reactNativeSurvicate = require("@survicate/react-native-survicate")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@survicate/react-native-survicate v1.0.2

React Native bindings for Survicate Mobile SDK

@survicate/react-native-survicate npm version

Requirements:

  • iOS at least on version 10.0
  • Android at least on version 4.4
  • React Native at least on version 0.59.10

Getting started

$ npm install @survicate/react-native-survicate --save

Mostly automatic installation

$ react-native link @survicate/react-native-survicate

Configuring Survicate Bindings for iOS

  • Add your Survicate workspace key to Info.plist
    <key>Survicate</key>
    <dict>
        <key>WorkspaceKey</key>
        <string>YOUR_WORKSPACE_KEY</string>
    </dict>
  • run command pod install in your ios directory

Configuring Survicate Bindings for Android

  • Add maven repository to your project build.gradle located under android directory
allprojects {
    repositories {
        // ...
        maven { url 'https://repo.survicate.com' }
    }
}
  • Add your Survicate workspace key to AndroidManifest.xml
<application
    android:name=".MyApp"
>
    <!-- ... -->
    <meta-data android:name="com.survicate.surveys.workspaceKey" android:value="YOUR_WORKSPACE_KEY"/>
</application>

Usage

import Survicate from '@survicate/react-native-survicate';

Survicate.initialize();
Survicate.invokeEvent("eventName");
Survicate.enterScreen("screenName");
Survicate.leaveScreen("screenName");
Survicate.setUserId("screenName");
Survicate.setUserTrait("traitName", "traitValue");
Survicate.reset();
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free