Public Classes

ReferralHero Kotlin / Java SDK

There are mainly 2 classes used by the ReferralHero SDK as the Kotlin Data classes for storing and accessing various related properties efficiently, allowing the SDK to easily manage and structure large sets of data.

Also, it is much easier for the developers integrating our SDK to understand data being returned or passed as part of the various methods or callbacks, making the whole integration process simple.

  1. ReferralParams

  2. SubscriberData

1. ReferralParams

This class provides various methods to set several user referral details like name, email, device, etc. This class is used mainly to pass referral details data to the SDK while accessing its public method or while updating the user information.

ReferralParams setter method for Java

Method

Description

setTransactionId(String value)

The unique ID of the transaction. Useful for tracking referrals for purchases.

setConversionCategory(String value)

The type of referral. Useful for creating reports.

settConversionValue(Int value)

The monetary value of the referral.

setDevice(String value)

The device used by the subscriber to sign up. Used for analytics.

setEmail(String value)

The email of the subscriber.

setDomain(String value)

The URL for the referral link.

setName(String value)

The name of the subscriber.

setReferrer(String value)

Set a referrer for the subscriber by providing the referrer's referral code or email.

setUuid(String value)

The list UUID.

setOsType(String value)

The os type of device used by the subscriber.

setSource(String value)

The source of the subscriber. Used for analytics.

setCryptoWalletAddress(String value)

The crypto wallet address

setExtraField(String value)

The extra field of the subscriber.

setExtraField2(String value)

The extra field 2 of the subscriber.

setIpAddress(String value)

The ip address of the device used by the subscriber.

setPoints(Int value)

The number of points for the subscriber. Only applicable for "contest" campaigns.

setPhoneNumber(String value)

The Phone Number of subscriber

setScreenSize(String value)

The screen size of the device used by the subscriber.

setSubscriber_id(String value)

Set Subscriber ID

setSocial(String value)

Social shares like facebook,instagram,email,whatsapp etc..

setDoubleOptIn(boolean value)

If set to false, the subscriber will not receive a confirmation email.

NOTE:

The parameters need to be sent in the correct order for our system to automatically generate a referral.

2. Subscriber Data

This class contains various member variables, each specifying some Subscriber related data.

Here is subscriber Data Class Code in Kotlin

data class SubscriberData(
   val id: String?,
   val name: String?,
   val email: String?,
   val phone_number: String?,
   val crypto_wallet_address: String?,
   val crypto_wallet_provider: String?,
   val extra_field: String?,
   val extra_field_2: String?,
   val option_field: String?,
   val conversion_amount: Double?,
   val code: String?,
   val position: Int?,
   val referred: Boolean?,
   val referred_by: ReferredBy?,
   val people_referred: Int?,
   val promoted: Boolean?,
   val promoted_at: Long?,
   val verified: Boolean?,
   val verified_at: Long?,
   val points: Int?,
   val risk_level: Int?,
   val host: String?,
   val source: String?,
   val device: String?,
   val referral_link: String?,
   val status: String?,
   val universal_link: String?,
   val created_at: Long,
   val last_updated_at: Long?,
   val response: String?
)

data class ReferredBy(
   val id: String?,
   val name: String?,
   val email: String?,
   val phone_number: String?,
   val people_referred: Int?,
   val points: Int?,
)

3. List Subscriber Data

This class contains various member variables, each specifying some Subscriber related data.

Here is subscriber Data Class Code in Kotlin

data class ListSubscriberData(
   val response: String,
   val subscribers: List<SubscriberData> = emptyList(),
   val rewards: List<Reward> = emptyList(),
   val pagination: Pagination
)

data class Reward(
   val id: Long,
   val name: String,
   val status: String,
   val image_url: String?,
   val referrals: Any?,
   val createdAt: Long,
   val signupType: String,
   val referralsType: Any?,
   val recurringCount: Any?,
)

data class Pagination(
   val total_pages: Int, val current_page: Int, val per_page: Int, val total_objects: Int
)

Last updated