Airship integration

Connect Woosmap Geofencing SDK with Airship

  1. Airship Integration
  2. Events definition

Woosmap Geofencing SDK can send events to Airship from different context types: Geofences, POI, Visits and ZOI.

Whenever location events trigger, you can send custom events with associated properties to your App via a listener method. 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

Configuration

To configure your app with the Airship SDK follow the instructions on the dedicated Getting Started guide on https://docs.airship.com/platform/.

Send Airship Custom events from native code

Custom events let you track user activities and key conversions in your mobile app, and tie them back to corresponding push messaging campaigns. For a more detailed explanation on custom events and possible use cases, see the Airship Custom Events topic guide.

iOS - Swift example

swift
        public class AirshipEvents: AirshipEventsDelegate {
    
    public init() {}
    
    public func regionEnterEvent(regionEvent: Dictionary<String, Any>, eventName: String) {
        #if canImport(AirshipCore)
            let event = UACustomEvent(name: eventName, value: 1)
            event.properties = regionEvent
            event.track()
        #endif
    }

    

Android - Java example

java
        public class WoosRegionLogReadyListener implements Woosmap.RegionLogReadyListener {
    public void RegionLogReadyCallback(RegionLog regionLog) {
        onRegionLogCallback(regionLog);
    }
}

private void onRegionLogCallback(RegionLog regionLog) {
    if(AIRSHIP) {
        // Create and name an event
        CustomEvent.Builder eventBuilder = new CustomEvent.Builder(regionLog.didEnter ? "geofence_entered_event" : "geofence_exited_event");

        // Set custom event properties on the builder
        eventBuilder.addProperty("id",regionLog.id);
        eventBuilder.addProperty("radius", regionLog.radius);
        eventBuilder.addProperty("latitude", regionLog.lat);
        eventBuilder.addProperty("longitude", regionLog.lng);

        // Then record it
        CustomEvent event = eventBuilder.build();
        event.track();
    }
}

    

Send Airship Custom events from react-native-plugin-geofencing

To enhance the functionality of your app, you integrate Airship and configure it with your Airship account. For expert guidance on the setup and configuration process, kindly refer to the following links: https://docs.airship.com/platform/mobile/setup/sdk/react-native/. You can easily activate Airship event tracking in the geofence SDK once it has been integrated.

Enable the enableAirshipConnector parameter:

JavaScript
        import WoosmapGeofencing from '@woosmap/react-native-plugin-geofencing';
...
...
WoosmapGeofencing.initialize({
  privateKeyWoosmapAPI: '<<your key>>',
  enableAirshipConnector: true,
}).catch(error => {
  console.error(error);
});

    

Then some additional steps are required for Android and iOS:

For iOS Update your Podfile with this line and run pod install --repo-update

        pod 'react-native-plugin-geofencing/Airship', :path => '../node_modules/@woosmap/react-native-plugin-geofencing'

    

For Android

  1. Compile and Target SDK Versions:

Please update the build.gradle file:

        android {
   compileSdkVersion 31

   defaultConfig {
         minSdkVersion 21
         targetSdkVersion 31

         // ...
   }
}

    
  1. If you are obfuscating your APK then please add following rules in your proguard.rules file.
        -keep class org.json.** { *; }
-keepnames class org.json.** { *; }
-keep class com.urbanairship.** { *; }
-keepnames class com.urbanairship.** { *; }

    

Once Airship SDK initialized, enableAirshipConnector parameter enabled and additional steps for Android and iOS done, woos_geofence_entered_event and woos_geofence_exited_event events will be automatically pushed to the Airship platform.

Send Airship Custom events from geofencing_flutter_plugin

To enhance the functionality of your app, you integrate Airship and configure it with your Airship account. For expert guidance on the setup and configuration process, kindly refer to the following links: https://docs.airship.com/platform/mobile/setup/sdk/flutter/. You can easily activate Airship event tracking in the geofence SDK once it has been integrated.

Enable the enableAirshipConnector parameter:

dart
        import 'package:geofencing_flutter_plugin/geofencing_flutter_plugin.dart';

final geofencingFlutterPlugin = GeofencingFlutterPlugin();
...
...
geofencingFlutterPlugin.initialize({
  privateKeyWoosmapAPI: '<<your key>>',
  enableAirshipConnector: true,
}).catch(error => {
  console.error(error);
});

    

Then some additional steps are required for Android and iOS:

For iOS Update your Podfile with this line and run pod install --repo-update

swift
        pod 'geofencing_flutter_plugin/Airship', :path => '.symlinks/plugins/geofencing_flutter_plugin/ios'

    

For Android

  1. Compile and Target SDK Versions:

Please update the build.gradle file:

ruby
        android {
   compileSdkVersion 31

   defaultConfig {
         minSdkVersion 21
         targetSdkVersion 31

         // ...
   }
}

    
  1. If you are obfuscating your APK then please add following rules in your proguard.rules file.
ruby
        -keep class org.json.** { *; }
-keepnames class org.json.** { *; }
-keep class com.urbanairship.** { *; }
-keepnames class com.urbanairship.** { *; }

    

Once Airship SDK initialized, enableAirshipConnector parameter enabled and additional steps for Android and iOS done, woos_geofence_entered_event and woos_geofence_exited_event events will be automatically pushed to the Airship platform.

Events definition

Geofences Events

Event data specification

Field name Type Only if the region is a POI
date Datetime  
id String  
latitude Double  
longitude Double  
radius Double  
name String X
idStore String X
city String X
zipCode String X
country_code String X
address String X
tags String X
types String X
user_properties.[field_name] String X

POI Events

Event data specification

Field name Type
date Datetime
name String
idStore String
city String
zipCode String
distance String
country_code String
address String
tags String
types String
user_properties.[field_name] String
Was this article helpful?
Have more questions? Submit a request