urbanairship/android-library


Urban Airship Android SDK

Download


Step 1. Add the JitPack repository to your build file

Add it in your root settings.gradle at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url 'https://jitpack.io' }
		}
	}

Add it in your settings.gradle.kts at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url = uri("https://jitpack.io") }
		}
	}

Add to pom.xml

	<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
	</repositories>

Add it in your build.sbt at the end of resolvers:

 
    resolvers += "jitpack" at "https://jitpack.io"
        
    

Add it in your project.clj at the end of repositories:

 
    :repositories [["jitpack" "https://jitpack.io"]]
        
    

Step 2. Add the dependency

	dependencies {
		implementation 'com.github.urbanairship:android-library:16.3.3'
	}
	dependencies {
		implementation("com.github.urbanairship:android-library:16.3.3")
	}
	<dependency>
	    <groupId>com.github.urbanairship</groupId>
	    <artifactId>android-library</artifactId>
	    <version>16.3.3</version>
	</dependency>

                            
    libraryDependencies += "com.github.urbanairship" % "android-library" % "16.3.3"
        
        

                            
    :dependencies [[com.github.urbanairship/android-library "16.3.3"]]
        
        

Readme


Airship Android SDK

Maven Central License

The Airship SDK for Android provides a comprehensive way to integrate Airship's customer experience platform into your Android applications.

Features

  • Push Notifications - Rich, interactive push notifications with deep linking (FCM, HMS, ADM)
  • In-App Experiences - Contextual messaging, automation, and Scenes
  • Message Center - Inbox for push notifications and messages
  • Preference Center - User preference management with customizable UI
  • Feature Flags - Dynamic feature toggles and experimentation
  • Live Updates - Real-time content updates
  • Analytics - Comprehensive user behavior tracking
  • Contacts - User identification and contact management
  • Tags, Attributes & Subscription Lists - User segmentation, personalization, and subscription management
  • Privacy Controls - Granular data collection and feature management
  • Jetpack Compose Support - Modern Compose UI components

Installation

Add the Airship Android SDK to your project using Gradle. In your app's build.gradle.kts:

val airshipVersion = "<latest_version>"

dependencies {
    // Core SDK - Required for all features
    implementation("com.urbanairship.android:urbanairship-core:$airshipVersion")

    // --- Push Providers ---
    // Choose one or more
    implementation("com.urbanairship.android:urbanairship-fcm:$airshipVersion")   // Firebase Cloud Messaging
    implementation("com.urbanairship.android:urbanairship-hms:$airshipVersion")   // Huawei Mobile Services
    implementation("com.urbanairship.android:urbanairship-adm:$airshipVersion")   // Amazon Device Messaging

    // --- In-App Automation & Scenes ---
    implementation("com.urbanairship.android:urbanairship-automation:$airshipVersion")
    // Optional - For Jetpack Compose support in Scenes
    implementation("com.urbanairship.android:urbanairship-automation-compose:$airshipVersion")

    // --- Message Center ---
    // Choose one UI implementation
    implementation("com.urbanairship.android:urbanairship-message-center:$airshipVersion")   // View-based UI
    implementation("com.urbanairship.android:urbanairship-message-center-compose:$airshipVersion") // Compose UI

    // --- Preference Center ---
    // Choose one UI implementation
    implementation("com.urbanairship.android:urbanairship-preference-center:$airshipVersion")  // View-based UI
    implementation("com.urbanairship.android:urbanairship-preference-center-compose:$airshipVersion") // Compose UI
    
    // --- Feature Flags ---
    implementation("com.urbanairship.android:urbanairship-feature-flag:$airshipVersion")

    // --- Live Updates ---
    implementation("com.urbanairship.android:urbanairship-live-update:$airshipVersion")

    // --- Debug ---
    // Optional - For development builds only
    debugImplementation("com.urbanairship.android:urbanairship-debug:$airshipVersion")
}

Quick Start

1. Initialize Airship

Create an Autopilot class to automatically initialize Airship:

class MyAutopilot : Autopilot() {
    override fun createAirshipConfigOptions(context: Context): AirshipConfigOptions {
        return airshipConfigOptions {
            setAppKey("YOUR_DEFAULT_APP_KEY")
            setAppSecret("YOUR_DEFAULT_APP_SECRET")
            setInProduction(!BuildConfig.DEBUG)
        }
    }

    override fun onAirshipReady(context: Context) {
        // Airship is ready! Configure additional settings here.
        Airship.push.userNotificationsEnabled = true
    }
}

Register your Autopilot in your AndroidManifest.xml:

<application>
    <meta-data
        android:name="com.urbanairship.autopilot"
        android:value="com.example.MyAutopilot" />
</application>

2. Configure a Push Provider

Add the FCM module and Google Services plugin to your build.gradle:

dependencies {
    implementation("com.urbanairship.android:urbanairship-fcm:<latest_version>")
}

apply plugin: 'com.google.gms.google-services'

Add your google-services.json file to your app directory.

Requirements

  • Minimum SDK 23+ (Android 6.0+)
  • Compile SDK 36+ (Android 15+)

Documentation

Support

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.