{"id":20448594,"url":"https://github.com/datacamp/react-native-survicate","last_synced_at":"2025-05-08T20:33:06.675Z","repository":{"id":147371574,"uuid":"167939618","full_name":"datacamp/react-native-survicate","owner":"datacamp","description":"React Native bindings for the Survicate SDK","archived":true,"fork":false,"pushed_at":"2020-04-07T08:22:53.000Z","size":24,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-03-20T23:47:13.197Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datacamp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-28T10:01:50.000Z","updated_at":"2024-04-15T20:12:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"38a4011a-50e0-40eb-913f-996118fa5eb2","html_url":"https://github.com/datacamp/react-native-survicate","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datacamp%2Freact-native-survicate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datacamp%2Freact-native-survicate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datacamp%2Freact-native-survicate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datacamp%2Freact-native-survicate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datacamp","download_url":"https://codeload.github.com/datacamp/react-native-survicate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253145206,"owners_count":21861206,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T10:35:51.397Z","updated_at":"2025-05-08T20:33:06.613Z","avatar_url":"https://github.com/datacamp.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# @datacamp/react-native-survicate\n\nThis package provides React Native bindings for the Survicate Mobile SDK.\n\n## Getting started\n\nInstall the native Survicate Mobile SDK in your project by [following the official instructions](https://developers.survicate.com/mobile-sdk/).\n\nThen add the NPM package:\n\n`$ yarn add @datacamp/react-native-survicate`\n\n### Mostly automatic installation\n\n`$ react-native link @datacamp/react-native-survicate`\n\n### Manual installation\n\n\n#### iOS\n\n1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`\n2. Go to `node_modules` ➜ `@datacamp/react-native-survicate` and add `RNSurvicate.xcodeproj`\n3. In XCode, in the project navigator, select your project. Add `libRNSurvicate.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`\n4. Run your project (`Cmd+R`)\u003c\n\n#### Android\n\n1. Open up `android/app/src/main/java/[...]/MainActivity.java`\n  - Add `import com.reactlibrary.RNSurvicatePackage;` to the imports at the top of the file\n  - Add `new RNSurvicatePackage()` to the list returned by the `getPackages()` method\n2. Append the following lines to `android/settings.gradle`:\n  \t```\n  \tinclude ':@datacamp_react-native-survicate'\n  \tproject(':@datacamp_react-native-survicate').projectDir = new File(rootProject.projectDir, \t'../node_modules/@datacamp/react-native-survicate/android')\n  \t```\n3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:\n  \t```\n      implementation project(':@datacamp_react-native-survicate')\n  \t```\n\n## Usage\n\nThe package provides lightweight bindings around some of the common Survicate Mobile SDK API methods:\n\n```javascript\nimport Survicate from '@datacamp/react-native-survicate'\n\n// Log events\nSurvicate.invokeEvent(\"My Event\")\n\n// Log screen views\nSurvicate.enterScreen(\"My Screen\")\nSurvicate.leaveScreen(\"My Screen\")\n\n// Set user traits\nSurvicate.setUserId(\"12345\")\nSurvicate.setUserTrait(\"Eye Color\", \"Green\")\n```\n  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatacamp%2Freact-native-survicate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatacamp%2Freact-native-survicate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatacamp%2Freact-native-survicate/lists"}