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

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