UrbanAirship Destination
The Urban Airship destination code is open sourced on GitHub. Feel free to check it out: Android, iOS
Screen calls will generate Urban Airship screen tracking events. These events are exposed through Connect. Only the screen and category name will be used as the screen tracking event name.
When you identify a user, Urban Airship will use the userId to set the Named User. Named Users allow you to associate multiple devices to a single user or profile that may be associated with more than one device, e.g., an end-user's Android phone and tablet. A device can have only one Named User, and a single Named User should not be associated with more than 20 devices.
When track is called, an Urban Airship custom event will be created. The event's traits will will be automatically added as properties on the custom event and if revenue is present that will be set at the custom event's value.
Groups will be added as tags on the Urban Airship channel. Tags can then be used for audience segmentation when sending notifications or setting up automation rules.
- Include the Urban Airship dependency in the project's build.gradle file:
1repositories {2...34maven {5url "https://urbanairship.bintray.com/android"6}7}8910dependencies {11...1213// Urban Airship SDK14compile 'com.urbanairship.android:segment-integration:1.0.+'15}
- Verify the
applicationIdis set in the project's build.gradle file:
1android {2...34defaultConfig {5...67applicationId "com.example.application"8}9}
- Add the Urban Airship Destination factory:
1Analytics analytics = new Analytics.Builder(context, writeKey)2.use(UrbanAirshipIntegration.FACTORY)3...4.build();
Once the Urban Airship destination is ready, you can enable user notifications with the following:
1analytics.onIntegrationReady(UrbanAirshipIntegration.URBAN_AIRSHIP_KEY, new Analytics.Callback<Object>() {2@Override3public void onReady(Object instance) {4UAirship airship = (UAirship) instance;5airship.getPushManager().setUserNotificationsEnabled(true);6}7});
- Add the Urban Airship Segment Destination pod to your project's Podfile:
pod "UrbanAirship-iOS-Segment-Integration"
- Use the Urban Airship Destination:
1SEGAnalyticsConfiguration *config = [SEGAnalyticsConfiguration configurationWithWriteKey:@"YOUR_WRITE_KEY"];23[config use:[SEGUrbanAirshipIntegrationFactory instance]];45[SEGAnalytics setupWithConfiguration:config];
Once the Urban Airship destination is ready, you can enable user notifications with the following:
[UAirship push].userPushNotificationsEnabled = YES;
To listen for when the Urban Airship destination is ready, listen for the SEGAnalyticsIntegrationDidStart event in NSNotificationCenter:
1[[[NSNotificationCenter defaultCenter] addObserver:self2selector:@selector(airshipReady)3name:@"io.segment.analytics.integration.did.start"4object:[SEGUrbanAirshipIntegrationFactory instance].key];