The Airship Cordova plugin provides basic support for location services offered in the Airship SDK.

iOS Setup

For location services to be available in iOS, apps must add a dependency for AirshipLocationKit as well as AirshipKit. This can easily be done by adding the airship-location-cordova Cordova plugin to your project.

cordova plugin add https://github.com/urbanairship/airship-location-cordova

Once added, the airship-location-cordova plugin will link AirshipLocationKit and initialize on take off.

Location APIs

Enabling and disabling location features:

// Enable location

// Disable location

// Enable background location

// Disable background location

Querying location enabled status:

// Location enabled
var locationEnabled = UrbanAirship.isLocationEnabled()

// Background location enabled
var backgroundLocationAllowed = UrbanAirship.isBackgroundLocationAllowed()