Airship integration
Connect Woosmap Geofencing SDK with Airship
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
- SDK version 6.0 or later: Download the latest stable SDK from appropriate platform page.
- 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.
Configuration
To configure your app with the Airship SDK follow the instructions on the dedicated Getting Started guide on https://docs.airship.com/guides/.
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
import WoosmapGeofencing
#if canImport(AirshipCore)
import AirshipCore // Airship from Swift Package Manager
#elseif canImport(AirshipKit)
import AirshipKit // Airship from CocoaPods
#endif
public class AirshipEvents: AirshipEventsDelegate {
public init() {}
public func regionEnterEvent(regionEvent: [String: Any], eventName: String) {
#if canImport(AirshipCore) || canImport(AirshipKit)
var event = CustomEvent(name: eventName, value: 1)
try? event.setProperties(regionEvent)
event.track()
#endif
}
// Implement the other AirshipEventsDelegate methods the same way.
}
Android - Java example
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
The plugin sends events through the Airship SDK your app already uses. First install and configure @ua/react-native-airship with your Airship account, following the Airship React Native setup guide. Then enable the connector in the plugin.
Enable the enableAirshipConnector parameter:
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
Add this line to your Podfile, then run pod install:
pod 'react-native-plugin-geofencing/Airship', :path => '../node_modules/@woosmap/react-native-plugin-geofencing'
From plugin version 1.1.0, the Airship subspec connects the plugin to the Airship SDK that @ua/react-native-airship installs, whichever way it ships it: as Swift packages from version 27.0.0, or as CocoaPods pods in earlier versions. The plugin adds no Airship SDK of its own. The subspec requires iOS 16 or later.
If pod install stops with Unable to find a specification for `react-native-airship`, @ua/react-native-airship is not installed in your app. Install it, or remove the Airship line from your Podfile.
For Android
- Compile and Target SDK Versions:
Please update the build.gradle file:
android {
compileSdkVersion 36
defaultConfig {
minSdkVersion 28
targetSdkVersion 36
// ...
}
}
- If you are obfuscating your APK then please add following rules in your
proguard.rulesfile.
-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:
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
pod 'geofencing_flutter_plugin/Airship', :path => '.symlinks/plugins/geofencing_flutter_plugin/ios'
For Android
- Compile and Target SDK Versions:
Please update the build.gradle file:
android {
compileSdkVersion 36
defaultConfig {
minSdkVersion 28
targetSdkVersion 36
// ...
}
}
- If you are obfuscating your APK then please add following rules in your
proguard.rulesfile.
-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
- Enter eventName:
woos_geofence_entered_event - Exit eventName:
woos_geofence_exited_event
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
- eventName:
woos_POI_event
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 |