This guide assumes basic familiarity with Cordova (PhoneGap), Xcode, and Eclipse. For a more detailed walkthrough of setting up a Cordova project, see the Cordova platform guides.
You should also have:
- Cordova 3.0 or later. For Cordova/PhoneGap 2.x, see the instructions here.
- iOS: Xcode and Xcode command line tools
- Android: Android Developer Tools with "android" tool in PATH (article)
Creating a Cordova app
Open a command terminal and cd to the directory where you want to create your Cordova project:
cordova create hello_connect com.example.helloconnect HelloConnect
This will create a directory named "hello_connect" with a basic Cordova app. Use the following commands to create iOS and Android projects:
cd hello_connect cordova platform add android cordova platform add ios
NOTE: Due to a bug in the current version of Cordova, do not put any spaces in the app name.
Add the Connect SDK Cordova pluginThis will download and install the Connect SDK plugin:
cordova plugin add https://github.com/ConnectSDK/Connect-SDK-Cordova-Plugin.git#master
- The iOS Xcode project is located in platforms/ios
- The Android Eclipse project is located in platforms/android
Follow the directions to add Connect SDK to the native projects:
Running the Cordova hello example
Select the project, then go to the "Run" menu and select "Run".
From the "Product" menu, select "Run".
To run on a real device, you will need to set up a provisioning profile