### Start React Native Metro Bundler Source: https://github.com/survicate/survicate-react-native-sdk/blob/master/example/react_native/README.md Commands to initiate the Metro JavaScript bundler, which is essential for serving the React Native application's JavaScript code. This process should run in its own terminal. ```Bash npm start ``` ```Bash yarn start ``` -------------------------------- ### Run React Native iOS Application Source: https://github.com/survicate/survicate-react-native-sdk/blob/master/test/react_native/README.md Commands to launch the React Native application on an iOS simulator or a connected iOS device. This command compiles and deploys the app, then starts it. ```bash npm run ios ``` ```bash yarn ios ``` -------------------------------- ### Start React Native Metro Bundler Source: https://github.com/survicate/survicate-react-native-sdk/blob/master/test/react_native/README.md Commands to start the Metro JavaScript bundler for a React Native project. The Metro bundler is essential for development, compiling JavaScript code and serving assets to the application. ```bash npm start ``` ```bash yarn start ``` -------------------------------- ### Run React Native Android Application Source: https://github.com/survicate/survicate-react-native-sdk/blob/master/test/react_native/README.md Commands to launch the React Native application on an Android emulator or a connected Android device. This command builds and deploys the app, then starts it. ```bash npm run android ``` ```bash yarn android ``` -------------------------------- ### Run React Native Application on iOS Source: https://github.com/survicate/survicate-react-native-sdk/blob/master/example/react_native/README.md Commands to build and launch the React Native application on an iOS simulator or a connected iOS device. These commands should be executed in a new terminal after the Metro bundler has been started. ```Bash npm run ios ``` ```Bash yarn ios ``` -------------------------------- ### Run React Native Application on Android Source: https://github.com/survicate/survicate-react-native-sdk/blob/master/example/react_native/README.md Commands to build and launch the React Native application on an Android emulator or a connected Android device. These commands should be executed in a new terminal after the Metro bundler has been started. ```Bash npm run android ``` ```Bash yarn android ``` -------------------------------- ### Install Survicate React Native SDK with npm Source: https://github.com/survicate/survicate-react-native-sdk/blob/master/README.md Command to install the `@survicate/react-native-survicate` package using npm, saving it as a dependency in your project. ```sh npm install @survicate/react-native-survicate --save ``` -------------------------------- ### Install Survicate React Native SDK with yarn Source: https://github.com/survicate/survicate-react-native-sdk/blob/master/README.md Command to install the `@survicate/react-native-survicate` package using yarn, adding it to your project's dependencies. ```sh yarn add @survicate/react-native-survicate ``` -------------------------------- ### Install Survicate React Native SDK with Expo Source: https://github.com/survicate/survicate-react-native-sdk/blob/master/README.md Command to install the `@survicate/react-native-survicate` package in an Expo managed project. Note that 'Expo Go' is not available due to custom native code. ```sh expo install @survicate/react-native-survicate ``` -------------------------------- ### Survicate React Native SDK Usage and API Source: https://github.com/survicate/survicate-react-native-sdk/blob/master/README.md Comprehensive example demonstrating the core functionalities of the Survicate React Native SDK. This includes SDK initialization, setting the workspace key, invoking events with and without properties, managing screen entry/exit, setting various user trait types (string, number, boolean, date), setting locale, adding and removing event listeners for survey lifecycle events, and resetting the SDK. ```javascript import Survicate, {UserTrait} from '@survicate/react-native-survicate; Survicate.initializeSdk(); Survicate.setWorkspaceKey('WORKSPACE_KEY'); Survicate.invokeEvent("eventName"); const properties = { "property1": "value1", "property2": "value2" }; Survicate.invokeEvent("eventName", properties); Survicate.enterScreen("screenName"); Survicate.leaveScreen("screenName"); const userIdTrait = new UserTrait('user_id', 'id'); Survicate.setUserTrait(userIdTrait); const textTrait = new UserTrait('name', 'John'); const numberTrait = new UserTrait('age', 25); const booleanTrait = new UserTrait('isPremium', true); const dateTrait = new UserTrait('lastLogin', new Date()); const timeIntervalTrait = new UserTrait('timeOfPurchase', new Date()); Survicate.setLocale('en-US'); const listener: SurvicateEventListener = { onSurveyDisplayed(event: SurveyDisplayedEvent) {}, onQuestionAnswered(event: QuestionAnsweredEvent) {}, onSurveyClosed(event: SurveyClosedEvent) {}, onSurveyCompleted(event: SurveyCompletedEvent) {}, } const subscription = Survicate.addSurvicateEventListener(listener); Survicate.reset(); ``` -------------------------------- ### Configure Survicate Workspace Key for iOS Source: https://github.com/survicate/survicate-react-native-sdk/blob/master/README.md XML snippet to add the Survicate workspace key to the `Info.plist` file in an iOS project. This key is essential for the SDK to connect to your specific Survicate workspace. ```xml Survicate WorkspaceKey YOUR_WORKSPACE_KEY ``` -------------------------------- ### Configure Survicate Workspace Key for Android Source: https://github.com/survicate/survicate-react-native-sdk/blob/master/README.md XML snippet to add the Survicate workspace key as a meta-data entry within the `` tag of your `AndroidManifest.xml` file. This configures the SDK with your workspace key on Android. ```xml ``` -------------------------------- ### Configure Survicate Plugin for Expo Source: https://github.com/survicate/survicate-react-native-sdk/blob/master/README.md JSON configuration to add the Survicate config plugin to the `plugins` array in your `app.json` or `app.config.js` for Expo projects. This enables automatic native configuration for the Survicate SDK, requiring a rebuild after changes. ```json { "expo": { "plugins": [ [ "@survicate/react-native-survicate", { "workspaceKey": "YOUR_WORKSPACE_KEY" } ] ] } } ``` -------------------------------- ### Add Survicate Maven Repository for Android Source: https://github.com/survicate/survicate-react-native-sdk/blob/master/README.md Gradle snippet to add the Survicate Maven repository to the `allprojects` block in your Android `build.gradle` file. This allows your project to resolve and download Survicate SDK dependencies. ```java allprojects { repositories { // ... maven { url 'https://repo.survicate.com' } } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.