Location

The Airship React Native 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 and entry to your app's Podfile:

pod 'UrbanAirship-iOS-Location', '~>11.0'

Afterwards, make sure to update your pods:

$ pod install

Location APIs

Enabling and disabling location features
// Enable location
UrbanAirship.setLocationEnabled(true)

// Disable location
UrbanAirship.setLocationEnabled(false)

// Enable background location
UrbanAirship.setBackgroundLocationAllowed(true)

// Disable background location
UrbanAirship.setBackgroundLocationAllowed(false)
Querying location enabled status
// Location enabled
var locationEnabled = UrbanAirship.isLocationEnabled()

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