{"_id":"57b96d6c1d08500e00bf822d","parentDoc":null,"version":{"_id":"57b96d6b1d08500e00bf81d1","__v":7,"project":"54861bb654b3ce0b00367292","createdAt":"2016-08-21T08:59:23.326Z","releaseDate":"2016-08-21T08:59:23.326Z","categories":["57b96d6b1d08500e00bf81d2","57b96d6b1d08500e00bf81d3","57b96d6b1d08500e00bf81d4","57b96d6b1d08500e00bf81d5","57b96d6b1d08500e00bf81d6","57b96d6b1d08500e00bf81d7","57b96d6b1d08500e00bf81d8","57b96d6b1d08500e00bf81d9","57b96d6b1d08500e00bf81da","57b96d6b1d08500e00bf81db","57b96d6b1d08500e00bf81dc","57b97748306b9b0e001dd53f","57d12c6c1227b40e0044908a","57d51ad68191880e008bb51b","57d52b5cf350090e00fe073e","57d5468a17b492170053a3f0","57df9df05927cb0e002bce1e"],"is_deprecated":true,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"","version_clean":"4.0.0","version":"4.0"},"__v":0,"project":"54861bb654b3ce0b00367292","user":"548d74b716fc980b00e2a786","category":{"_id":"57b97748306b9b0e001dd53f","__v":0,"version":"57b96d6b1d08500e00bf81d1","project":"54861bb654b3ce0b00367292","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-08-21T09:41:28.604Z","from_sync":false,"order":6,"slug":"android-setup","title":"Cordova / Essentials KIt"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-03-22T15:40:54.908Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Add the Elasticode plugin to your app\"\n}\n[/block]\n**1. Download the plugin**\n**2. Install the plugin into the cordova project**\n    ```cd``` into root of your cordova/phonegap project\n    \nFor iOS add variable IOS_URL_SCHEME for elasticode url scheme like so:\n(While ecXXXXXXXX is your iOS url scheme)\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"cordova plugin add /PATH/TO/PLUGIN/elasticode-cordova-plugin --variable IOS_URL_SCHEME=ecXXXXXXXX\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nFor Android add variable ANDROID_URL_SCHEME for elasticode url scheme like so:\n(While ecXXXXXXXX is your android url scheme)\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"cordova plugin add /PATH/TO/PLUGIN/elasticode-cordova-plugin --variable ANDROID_URL_SCHEME=ecXXXXXXXX\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\nFor using both platforms:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"cordova plugin add /PATH/TO/PLUGIN/elasticode-cordova-plugin --variable IOS_URL_SCHEME=ecXXXXXXXX --variable ANDROID_URL_SCHEME=ecXXXXXXXX\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n**3. Add the following in your ```deviceready``` event callback:**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"window.elasticode.setAndroidApiKey(\\\"<AndroidAPIKey>\\\");\\nwindow.elasticode.setIOSApiKey(\\\"<iOSAPIKey>\\\");\\n\\nwindow.elasticode.ready();\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n**4. Build your app** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"cordova build\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]","excerpt":"How to integrate the elasticode cordova plugin to your project","slug":"cordova-setup","type":"basic","title":"Basic Setup"}

Basic Setup

How to integrate the elasticode cordova plugin to your project

[block:api-header] { "type": "basic", "title": "Add the Elasticode plugin to your app" } [/block] **1. Download the plugin** **2. Install the plugin into the cordova project** ```cd``` into root of your cordova/phonegap project For iOS add variable IOS_URL_SCHEME for elasticode url scheme like so: (While ecXXXXXXXX is your iOS url scheme) [block:code] { "codes": [ { "code": "cordova plugin add /PATH/TO/PLUGIN/elasticode-cordova-plugin --variable IOS_URL_SCHEME=ecXXXXXXXX", "language": "shell" } ] } [/block] For Android add variable ANDROID_URL_SCHEME for elasticode url scheme like so: (While ecXXXXXXXX is your android url scheme) [block:code] { "codes": [ { "code": "cordova plugin add /PATH/TO/PLUGIN/elasticode-cordova-plugin --variable ANDROID_URL_SCHEME=ecXXXXXXXX", "language": "shell" } ] } [/block] For using both platforms: [block:code] { "codes": [ { "code": "cordova plugin add /PATH/TO/PLUGIN/elasticode-cordova-plugin --variable IOS_URL_SCHEME=ecXXXXXXXX --variable ANDROID_URL_SCHEME=ecXXXXXXXX", "language": "shell" } ] } [/block] **3. Add the following in your ```deviceready``` event callback:** [block:code] { "codes": [ { "code": "window.elasticode.setAndroidApiKey(\"<AndroidAPIKey>\");\nwindow.elasticode.setIOSApiKey(\"<iOSAPIKey>\");\n\nwindow.elasticode.ready();", "language": "javascript" } ] } [/block] **4. Build your app** [block:code] { "codes": [ { "code": "cordova build", "language": "shell" } ] } [/block]