Airship Integration - iOS

Plug Airship to Woosmap Geofencing SDK.
  1. Airship Integration
  2. Events and Properties

Airship Integration

Generate contextual events from Geofencing SDK data using different event types: Geofences, POI, Visits and ZOI.

Whenever location events are generated, the Geofencing SDK will send custom events and properties to your App via a delegate protocol. Your App can then pass them to the Airship SDK and use the Custom Event trigger in the Automation and Journey composers.

Airship Integration Requirements

Airship

  1. SDK version 6.0 or later: Download the latest stable SDK from appropriate Platform page.
  2. Account Entitlements: Account-level permissions apply, based on your pricing package. Contact Airship Sales with any questions related to pricing and entitlements for location and automation services.

Configure Airship Integration in your app

To configure your app with the Airship SDK follow the instruction on the Airship web site : https://docs.airship.com/platform/ios/getting-started/

Set up Airship events

The first step in sending custom events to Airship is to set airshipEventsDelegate, this should be done as early as possible in your didFinishLaunchingWithOptions App Delegate.

let dataLocation = DataLocation()
let dataPOI = DataPOI()
let dataDistance = DataDistance()
let dataRegion = DataRegion()
let dataVisit = DataVisit()
let airshipEvents = AirshipEvents()

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
	
	#if canImport(AirshipCore)
        // Populate AirshipConfig.plist with your app's info from https://go.urbanairship.com
        // or set runtime properties here.
        let config = UAConfig.default()

        if (config.validate() != true) {
            showInvalidConfigAlert()
            return true
        }

        // Set log level for debugging config loading (optional)
        // It will be set to the value in the loaded config upon takeOff
        UAirship.setLogLevel(UALogLevel.trace)

        config.messageCenterStyleConfig = "UAMessageCenterDefaultStyle"

        // You can then programmatically override the plist values:
        // config.developmentAppKey = "YourKey"
        // etc.
        // Call takeOff (which creates the UAirship singleton)
        UAirship.takeOff(config)
        UAirship.push()?.userPushNotificationsEnabled = true
        UAirship.push()?.defaultPresentationOptions = [.alert,.badge,.sound]
        UAirship.push()?.isAutobadgeEnabled = true


        // Print out the application configuration for debugging (optional)
        print("Config:\n \(config)")
        WoosmapGeofencing.shared.getLocationService().airshipEventsDelegate = airshipEvents
	#endif

Retrieve Airship events

In your class delegate, retrieve custom events data :

public class AirshipEvents: AirshipEventsDelegate {
    
    public init() {}
    
    public func regionEnterEvent(regionEvent: Dictionary<String, Any>, eventName: String) {
        #if canImport(AirshipCore)
        // here you can modify your event name and add your data in the dictonnary
            let event = UACustomEvent(name: eventName, value: 1)
            event.properties = regionEvent
            event.track()
        #endif
    }
    
    public func regionExitEvent(regionEvent: Dictionary<String, Any>, eventName: String) {
        #if canImport(AirshipCore)
        // here you can modify your event name and add your data in the dictonnary
            let event = UACustomEvent(name: eventName, value: 1)
            event.properties = regionEvent
            event.track()
        #endif
    }
    
    public func visitEvent(visitEvent: Dictionary<String, Any>, eventName: String) {
        #if canImport(AirshipCore)
        // here you can modify your event name and add your data in the dictonnary
            let event = UACustomEvent(name: eventName, value: 1)
            event.properties = visitEvent
            event.track()
        #endif
    }
    
    public func poiEvent(POIEvent: Dictionary<String, Any>, eventName: String) {
        #if canImport(AirshipCore)
        // here you can modify your event name and add your data in the dictonnary
            let event = UACustomEvent(name: eventName, value: 1)
            event.properties = POIEvent
            event.track()
        #endif
    }
    
    public func ZOIclassifiedEnter(regionEvent: Dictionary<String, Any>, eventName: String) {
        #if canImport(AirshipCore)
        // here you can modify your event name and add your data in the dictonnary
            let event = UACustomEvent(name: eventName, value: 1)
            event.properties = regionEvent
            event.track()
        #endif
    }
    
    public func ZOIclassifiedExit(regionEvent: Dictionary<String, Any>, eventName: String) {
        #if canImport(AirshipCore)
        // here you can modify your event name and add your data in the dictonnary
            let event = UACustomEvent(name: eventName, value: 1)
            event.properties = regionEvent
            event.track()
        #endif
    }
}
    

Events and Properties

Geofences

woos_geofence_entered_event

date: String
id: String
latitude: Double
longitude: Double
radius: Double Additionnals data if the region is a POI : name: String
idStore: String
city: String
zipCode: String distance: String
country_code: String address: String tags: String
types: String
user-properties: String

woos_geofence_exited_event

date: String
id: String
latitude: Double
longitude: Double
radius: Double Additionnals data if the region is a POI : name: String
idStore: String
city: String
zipCode: String distance: String
country_code: String address: String tags: String
types: String
user-properties: String

woos_zoi_classified_entered_event

date: String
id: String
latitude: Double
longitude: Double
radius: Double

woos_zoi_classified_exited_event

date: String
id: String
latitude: Double
longitude: Double
radius: Double

POI

woos_POI_event

date: String
name: String
idStore: String
city: String
zipCode: String distance: String
country_code: String address: String tags: String
types: String
user-properties: String

Visit

woos_Visit_event date: String
arrivalDate: String
departureDate: String
id: String
latitude: Double
longitude: Double