{"_id":"5c73dd58e397ae00137cf4a6","project":"54aa7f773b56130b0056c86e","version":{"_id":"55781fe25129590d003ff4f7","project":"54aa7f773b56130b0056c86e","forked_from":"54aa7f773b56130b0056c871","__v":8,"createdAt":"2015-06-10T11:30:42.700Z","releaseDate":"2015-06-10T11:30:42.700Z","categories":["55781fe35129590d003ff4f8","55781fe35129590d003ff4f9","55781fe35129590d003ff4fa","55781fe35129590d003ff4fb","55781fe35129590d003ff4fc","55781fe35129590d003ff4fd","55781fe35129590d003ff4fe","564bbc7e8841060d00abb2ee","565b66c446118c0d00dcb0bb","56898269f8dc340d00308c13","582318b23b961a0f009516a1","594a848c9f4771001a43c959","5c73dd27e8fdc000572a206a","5c77ac5af94a920045cb80ca"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Developers","version_clean":"2.0.0","version":"2.0"},"category":{"_id":"5c77ac5af94a920045cb80ca","project":"54aa7f773b56130b0056c86e","version":"55781fe25129590d003ff4f7","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2019-02-28T09:39:38.102Z","from_sync":false,"order":5,"slug":"react","title":"React Native SDK"},"user":"57bc3654b9c7f0220009c77b","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2019-02-25T12:19:36.996Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"React Native is a JavaScript framework for writing real, natively rendering mobile applications for iOS and Android. The Pulsate React SDK exposes the native Pulsate SDKs and allows using their methods directly in JavaScript.\n[block:api-header]\n{\n  \"title\": \"Creating a React App and installing the Pulsate SDK\"\n}\n[/block]\nTo create a React App run the following commands in the terminal. This command will create a new project called \"MyAppName\" and setup the Android and iOS App.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"react-native init MyAppName\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nNext we need to install the Pulsate SDK. To do this we first need to move into the newly created folder named \"MyAppName\" after that we run a command to install Pulsate and we finish with running a command that will link the Pulsate SDK with the Android / iOS apps.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"cd MyAppName\\nnpm install pulsate-react-native-sdk\\nreact-native link pulsate-react-native-sdk\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nWe now need to make sure that all the dependencies are setup properly. Open the package.json file and add / replace these brackets.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"\\\"dependencies\\\": {\\n    \\\"react\\\": \\\"16.6.1\\\",\\n    \\\"react-native\\\": \\\"0.57.5\\\",\\n    \\\"pulsate-react-native-sdk\\\": \\\"^1.0.0\\\"\\n},\\n\\\"devDependencies\\\": {\\n    \\\"babel-jest\\\": \\\"23.6.0\\\",\\n    \\\"jest\\\": \\\"23.6.0\\\",\\n    \\\"metro-react-native-babel-preset\\\": \\\"0.49.1\\\",\\n    \\\"react-test-renderer\\\": \\\"16.6.1\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Dependency Versions\",\n  \"body\": \"Your App should already have all or most of these dependencies, please make sure that you use the versions listed above.\"\n}\n[/block]\nAfter changing the dependencies delete the node_modules folder and reinstall all dependencies using the following command\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"npm install\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nYou will now have all proper dependencies for your React App. Next we need to do some manual setup both for the iOS and Android Apps. The instructions for both iOS and Android can be found under these links:\n\n[Android](https://pulsate.readme.io/v2.0/docs/setting-up-the-pulsate-react-sdk-android)\n[iOS](https://pulsate.readme.io/v2.0/docs/setting-up-the-pulsate-react-sdk-ios)","excerpt":"","slug":"installing-the-react-plugin","type":"basic","title":"Installing the Pulsate React SDK"}

Installing the Pulsate React SDK


React Native is a JavaScript framework for writing real, natively rendering mobile applications for iOS and Android. The Pulsate React SDK exposes the native Pulsate SDKs and allows using their methods directly in JavaScript. [block:api-header] { "title": "Creating a React App and installing the Pulsate SDK" } [/block] To create a React App run the following commands in the terminal. This command will create a new project called "MyAppName" and setup the Android and iOS App. [block:code] { "codes": [ { "code": "react-native init MyAppName", "language": "text" } ] } [/block] Next we need to install the Pulsate SDK. To do this we first need to move into the newly created folder named "MyAppName" after that we run a command to install Pulsate and we finish with running a command that will link the Pulsate SDK with the Android / iOS apps. [block:code] { "codes": [ { "code": "cd MyAppName\nnpm install pulsate-react-native-sdk\nreact-native link pulsate-react-native-sdk", "language": "text" } ] } [/block] We now need to make sure that all the dependencies are setup properly. Open the package.json file and add / replace these brackets. [block:code] { "codes": [ { "code": "\"dependencies\": {\n \"react\": \"16.6.1\",\n \"react-native\": \"0.57.5\",\n \"pulsate-react-native-sdk\": \"^1.0.0\"\n},\n\"devDependencies\": {\n \"babel-jest\": \"23.6.0\",\n \"jest\": \"23.6.0\",\n \"metro-react-native-babel-preset\": \"0.49.1\",\n \"react-test-renderer\": \"16.6.1\"\n}", "language": "json" } ] } [/block] [block:callout] { "type": "warning", "title": "Dependency Versions", "body": "Your App should already have all or most of these dependencies, please make sure that you use the versions listed above." } [/block] After changing the dependencies delete the node_modules folder and reinstall all dependencies using the following command [block:code] { "codes": [ { "code": "npm install", "language": "text" } ] } [/block] You will now have all proper dependencies for your React App. Next we need to do some manual setup both for the iOS and Android Apps. The instructions for both iOS and Android can be found under these links: [Android](https://pulsate.readme.io/v2.0/docs/setting-up-the-pulsate-react-sdk-android) [iOS](https://pulsate.readme.io/v2.0/docs/setting-up-the-pulsate-react-sdk-ios)