Book Image

PhoneGap for Enterprise

By : Kerri Shotts
Book Image

PhoneGap for Enterprise

By: Kerri Shotts

Overview of this book

Table of Contents (16 chapters)
PhoneGap for Enterprise
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Integrating Boxcar with PhoneGap/Cordova


At this point, we can create a PhoneGap/Cordova project and integrate it with Boxcar. We've got a sample project at /ch7 in the code package; all it does is respond to Push Notifications by displaying an alert. You're welcome to use our code as a base, or perform the following steps to integrate Boxcar with your app:

  1. Create your project using the Cordova CLI as normal (however, use the app ID you used when setting up Push Notifications):

    cordova create ./ch7 com.packtpub.pgech7 TaskerCH7
  2. Add the iOS and Android platforms:

    cordova platform add ios android
  3. Add the necessary plugins; Boxcar requires the following two plugins:

    cordova plugin add org.apache.cordova.device
    cordova plugin add https://github.com/boxcar/PushPlugin
  4. Copy the Boxcar.js file from the Boxcar SDK and place it in your project's www directory.

    Tip

    We had to make several changes to the Boxcar.js file in order to function as needed for our purposes. We've submitted these features and bug fixes...