Skip to content

CoinStatsHQ/AppLinkAI-Android

Repository files navigation

AppLinkAI Android SDK

Tag: 1.2.1

Lightweight Android/Kotlin SDK to verify deep links and receive enriched parameters from the AppLinkAI platform. The SDK handles network calls, parsing, and provides a simple API to integrate into your app.

Note: Your app must request Internet access:

<uses-permission android:name="android.permission.INTERNET" />

Installation

Replace $tag with the current version number. Add the dependency to your Android project:

Gradle (Kotlin DSL):

dependencies {
    implementation("applink.ai:AppLinkAI-Android:$tag")
}

Gradle (Groovy):

dependencies {
    implementation 'applink.ai:AppLinkAI-Android:$tag'
}

Maven:

<dependency>
  <groupId>applink.ai</groupId>
  <artifactId>AppLinkAI-Android</artifactId>
  <version>$tag</version>
  <type>aar</type>
</dependency>

Required Dependencies

Before using the SDK, make sure to add these dependencies to your app/module build.gradle.kts file:

dependencies {
    implementation("com.squareup.retrofit2:retrofit")
    implementation("com.squareup.retrofit2:converter-gson")
    implementation("com.squareup.okhttp3:okhttp")
    implementation("com.google.code.gson:gson")
    implementation("androidx.lifecycle:lifecycle-runtime-ktx")
    implementation("com.squareup.okhttp3:logging-interceptor")
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android")
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core")
}

Minimal Usage

Kotlin example (e.g., in your main Activity):

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        AppLink.initialize(
            activity = this,
            apiKey = "YOUR_API_KEY",
            isTestMode = false,
            deepLinkHandler = { paramsJson ->
                // Handle the deep link parameters
                Log.d("AppLinkAI", paramsJson.toString())
            },
            errorHandler = { errorMessage ->
                // Handle any errors
                Log.e("AppLinkAI", errorMessage)
            }
        )
    }
}

The library generates a JSONObject with these parameters:

"+sourceUrlKey", "+sourceUrlPathKey", "+IsFirstSessionKey"

Key Class

  • AppLink: Primary entry point.
    • initialize(activity, apiKey, isTestMode, deepLinkHandler, errorHandler): Initializes the SDK and performs a verification call.
    • handleDeepLink(url: String): Optionally handle a deep link URL manually;.

License

This project is released under the MIT License. See LICENSE for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages