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.
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:
- Download and unzip the Urban Airship Gimbal Adapter
- Command/Right-click on your iOS project in Xcode
- Select Add files to <your project name here>...
- Navigate to the directory you unzipped your Gimbal Adapter to and select the iOS directory
- Select both the GimbalAdapter.h and the GimbalAdapter.m
- Click Add
4. Import Gimbal Adapter to your app:
In Xcode, navigate to the Plugins directory.
- Open UAirshipPlugin.m
- Add #import "GimbalAdapter.h" to your import statements
- In your didFinishLaunching method, set your Gimbal API Key before takeOff()
-
[Gimbal setAPIKey:@"<Your Gimbal API Key here>" options:nil];
- After takeOff(), start the Gimbal Adapter
-
[[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.
2. Update Android Manifest:
Follow the Gimbal instructions linked below to allow Gimbal to run in the background
3. Download and include Urban Airship Gimbal adapter into your app:
- Download and unzip the Urban Airship Gimbal Adapter
- 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.
- Open UAirshipPlugin.java
- Add import com.gimbal.android.Gimbal; to your import statements
- Before automaticTakeOff() in the initialize method, add your Gimbal API Key
-
Gimbal.setApiKey(this, <your_gimbal_api_key>);
- After automaticTakeOff(), start the Gimbal Adapter
-
GimbalAdapter.shared().start();