AppsOnAir-android-AppLink enables you to handle deep links, and in-app routing seamlessly in your Android app. With a simple integration, you can configure, manage, and act on links from the web dashboard in real time and for more detail refer documentation.
- ✅ Deep link support (URI scheme, AppLinks)
- ✅ Fallback behavior (e.g., open Play Store)
- ✅ Custom domain support
- ✅ Referral tracking
- ✅ Seamless migration from Firebase Dynamic Links to AppLink
Note: For comprehensive instructions on migrating Firebase Dynamic Links to AppLink, refer to the documentation.
- Android Gradle Plugin (AGP): Version 8.0.2 or higher
- Kotlin: Version 1.7.10 or higher
- Gradle: Version 8.0 or higher
dependencies {
implementation 'com.github.apps-on-air:AppsOnAir-android-AppLink:TAG'
}dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven {
url = uri("https://jitpack.io")
}
}
}Make sure meta-data name is “AppsonairAppId”.
Provide your application id in meta-data value.
</application>
...
<meta-data
android:name="AppsonairAppId"
android:value="********-****-****-****-************" />
</application> <intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="your domain"
android:scheme="https" />
</intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="open"
android:scheme="your scheme" />
</intent-filter> private lateinit var appLinkService: AppLinkService
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// Initialize deeplink service and set listener for deep link and referral link events
appLinkService = AppLinkService.getInstance(this)
// Initialize the AppLink to track the deeplink
appLinkService.initialize(this, intent, object : AppLinkListener {
override fun onDeepLinkProcessed(uri: Uri, result: JSONObject) {
// Perform your action on deep link
}
override fun onDeepLinkError(uri: Uri?, error: String) {
// Handle error when deep link processing fails
}
// Optional method
override fun onReferralLinkDetected(result: JSONObject) {
// Perform your action on referral data
}
})
}
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
appLinkService.handleDeepLink(
intent,
"com.example.appsonair_android_applink"
)
}
val socialMeta = mapOf(
"title" to "link title",
"description" to "link description",
"imageUrl" to "https://image.png"
)
CoroutineScope(Dispatchers.Main).launch {
val result = appLinkService.createAppLink(
name = "AppsOnAir",
url = "https://appsonair.com",
urlPrefix = "YOUR_DOMAIN_NAME", //shouldn't contain http or https
shortId = "LINK_ID", // If not set, it will be auto-generated
socialMeta = socialMeta,
androidFallbackUrl = "https://play.google.com",
isOpenInAndroidApp = true,
isOpenInBrowserAndroid = false
)
}
CoroutineScope(Dispatchers.Main).launch {
val referral = appLinkService.getReferralInfo()
}
The install referral data is available for up to 90 days. If you need access to it beyond that, you must store it locally within your app.
To test referral functionality, your app must be live on the Play Store. If it's not, you can use the application ID of any live app instead for testing purposes.
For testing:
-
Click the referral link, which should redirect you to the Play Store.
-
Do not press the "Install" button. Instead, open the app directly from your IDE (e.g., Android Studio) on the device.