How to use the Linkrunner SDK in your Android app
Application
class or main activity:
You can find your project token here.
Note: This method returns a void. To get attribution data and deeplink information,
use the getAttributionData method.
secretKey
: A unique secret key used for request signing and authenticationkeyId
: A unique identifier for the key pair used in the signing processsignup
method once after the user has completed your app’s onboarding process:
It is strongly recommended to use the integrated platform’s identify function to set a persistent user_id once it becomes available (typically after signup or login).
getAttributionData
function:
setUserData
each time the app opens and the user is logged in:
setAdditionalData
method to set CleverTap ID:
amount
parameter as a number in your custom event data. This allows the ad networks to optimize campaigns based on the revenue value of conversions:
amount
parameter is passed as a number (Double
or Int), not as a string.Type | Description |
---|---|
FIRST_PAYMENT | User’s first payment |
WALLET_TOPUP | Adding funds to wallet |
FUNDS_WITHDRAWAL | Withdrawing funds |
SUBSCRIPTION_CREATED | New subscription created |
SUBSCRIPTION_RENEWED | Subscription renewal |
ONE_TIME | One-time payment |
RECURRING | Recurring payment |
DEFAULT | Default payment type |
Status | Description |
---|---|
PAYMENT_INITIATED | Payment process started |
PAYMENT_COMPLETED | Payment successfully completed |
PAYMENT_FAILED | Payment failed |
PAYMENT_CANCELLED | Payment was cancelled |
Function | Where to Place | When to Call |
---|---|---|
LinkRunner.getInstance().init | Application class | Once when app starts |
LinkRunner.getInstance().getAttributionData | Attribution data handling flow | Whenever the attribution data is needed |
LinkRunner.getInstance().setAdditionalData | Integration code | When third-party integration IDs are available |
LinkRunner.getInstance().signup | Onboarding flow | Once after user completes onboarding |
LinkRunner.getInstance().setUserData | Authentication logic | Every time app opens with logged-in user |
LinkRunner.getInstance().trackEvent | Throughout app | When specific user actions occur |
LinkRunner.getInstance().capturePayment | Payment processing | When user makes a payment |
LinkRunner.getInstance().removePayment | Refund flow | When payment needs to be removed |