{"category":{"version":"588861fa165af631008ee1b8","project":"54861bb654b3ce0b00367292","_id":"588861fa165af631008ee1bf","__v":0,"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"},"parentDoc":null,"project":"54861bb654b3ce0b00367292","user":"548d74b716fc980b00e2a786","version":{"__v":1,"_id":"588861fa165af631008ee1b8","project":"54861bb654b3ce0b00367292","createdAt":"2017-01-25T08:29:46.061Z","releaseDate":"2017-01-25T08:29:46.061Z","categories":["588861fa165af631008ee1b9","588861fa165af631008ee1ba","588861fa165af631008ee1bb","588861fa165af631008ee1bc","588861fa165af631008ee1bd","588861fa165af631008ee1be","588861fa165af631008ee1bf","588861fa165af631008ee1c0","588861fa165af631008ee1c1","588861fa165af631008ee1c2","588861fa165af631008ee1c3","588861fa165af631008ee1c4","588861fa165af631008ee1c5","588861fa165af631008ee1c6","588861fa165af631008ee1c7","588861fa165af631008ee1c8","588861fa165af631008ee1c9"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"5.0.0","version":"5.0"},"_id":"588861fb165af631008ee203","__v":0,"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":43,"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]