How to use the Linkrunner SDK in your Android app
Application
class or main activity:
You can find your project token here.
secretKey
: A unique secret key used for request signing and authenticationkeyId
: A unique identifier for the key pair used in the signing processinit
signup
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).
setUserData
each time the app opens and the user is logged in:
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().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 |