Gradle
1. Installation
The initial step doesn't involve code; it occurs directly on our platform:
- For development environment, go to https://testapp.told.club/
- For production environment, go to https://app.told.club/
If it is not already done, you need to create a source:
- Click on
Sources
in the left panel. - Click on
+
card. - Use
In app survey
. - Use
Android
and enter a name for your source (it can be anything you want, it is just use to identify your source on our platform). - Go to the installation page:
https://{TOLD_URL}/source/{YOUR_SOURCE_ID}/installation
- Register your application ID
- Told Android SDK is published to Maven Central. Add dependency below:
In
libs.versions.toml
:
[versions]
toldSdk = "2.1.0"
[libraries]
toldSdk = { group = "club.told", name = "told-android-sdk", version.ref = "toldSdk" }
In your build.gradle.kts
file where you want to use Told:
dependencies {
implementation(libs.toldSdk)
}
Check existence or add mavenCentral()
in your settings.gradle.kts
root file:
dependencyResolutionManagement {
repositories {
mavenCentral()
}
}
2. Initialization
A common approach is to set up the Told SDK within your class that extends Application.
import android.app.Application
import com.told.sdk.ToldSDK
import com.told.sdk.ToldConfiguration
import com.told.sdk.ToldEnvironment
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
Told.init(
configuration = ToldConfiguration(
sourceId = "MySourceId",
applicationId = applicationContext.packageName,
appVersion = "${BuildConfig.VERSION_NAME}#${BuildConfig.VERSION_CODE}",
environment = ToldEnvironment.Production,
preview = false,
),
applicationContext = applicationContext,
)
}
}
Please ensure that:
Told.init
is called only once during your app lifecycle.- You use the
applicationContext
and not aContext
linked to an activity, fragment or a Composable.
3. Verification
Relaunch your application and if you have set everything up correctly, the status of your source should change to "Installed".
If the status remains unchanged, you can try the following steps:
- Ensure that you are correctly calling the SDK's init function.
- Verify that the source ID is accurate.
- Refresh the installation page to update the status.
- Check your Logcat for details. You can filter with
tag:Told
.
If none of these steps resolve the issue, please feel free to contact us directly via the "Contact us" button on our platform.