How to add Gimbal to my Phonegap app

Before you get started, ensure that you have downloaded the Gimbal SDK and installed the Urban Airship Phonegap plugin into your Phonegap app.  
   

iOS Integration:

1. Integrate Gimbal SDK in your app:

Follow the Gimbal instructions linked below to integrate the Gimbal framework into your Xcode project.

Gimbal - iOS Setup

2. Include Location Permissions in your app:

In Xcode, navigate to your app's Info.plist. Add the following rows:

NSLocationWhenInUseUsageDescription

NSLocationAlwaysUsageDescription

3. Download and include Urban Airship Gimbal adapter into your app: 

  1. Download and unzip the Urban Airship Gimbal Adapter
  2. Command/Right-click on your iOS project in Xcode
  3. Select Add files to <your project name here>...
  4. Navigate to the directory you unzipped your Gimbal Adapter to and select the iOS directory
  5. Select both the GimbalAdapter.h and the GimbalAdapter.m
  6. Click Add

4. Import Gimbal Adapter to your app:

In Xcode, navigate to the Plugins directory.

  1. Open UAirshipPlugin.m
  2. Add #import "GimbalAdapter.h" to your import statements
  3. In your didFinishLaunching method, set your Gimbal API Key before takeOff()
    1.     [Gimbal setAPIKey:@"<Your Gimbal API Key here>" options:nil];
  4. After takeOff(), start the Gimbal Adapter
    1.     [[GimbalAdapter shared] startAdapter];

Android Integration:

1. Integrate Gimbal SDK in your app:

Follow the Gimbal instructions linked below to integrate the Gimbal framework into your Android Studio project.

Gimbal - Android Studio setup

2. Update Android Manifest:

Follow the Gimbal instructions linked below to allow Gimbal to run in the background

Gimbal - Update Manifest

3. Download and include Urban Airship Gimbal adapter into your app:

  1. Download and unzip the Urban Airship Gimbal Adapter
  2. Drag the GimbalAdapter.java from your file explorer to the appropriate app folder in your Project Directory in Android Studio

4. Import Gimbal Adapter to your app:

In Android Studio, navigate to Plugins > urbanairship-cordova > src > android.

  1. Open UAirshipPlugin.java
  2. Add import com.gimbal.android.Gimbal; to your import statements
  3. Before automaticTakeOff() in the initialize method, add your Gimbal API Key
    1. Gimbal.setApiKey(this, <your_gimbal_api_key>);
  4. After automaticTakeOff(), start the Gimbal Adapter
    1. GimbalAdapter.shared().start();

Related Content

Was this article helpful?
0 out of 0 found this helpful
Submit a request