ReferralHero
  • Welcome to the Support Center
  • Common Questions
  • Features
    • Subscribers
      • Subscriber Profile
      • Unique Identifier
      • Active Visitors
      • 'Quick Add' Referral
      • Update Referral Status
    • Campaign Templates
      • Contest
      • Website Referral Analysis
      • Net Promoter Score
    • Unique Identifier
      • Phone Number
      • Confirmation Email
        • Thank-You Page
    • Automations
      • A/B Test
    • Security
      • Manual Review & Confirmation
      • Secondary Verification Method
      • High Risk
      • Blacklist
      • ReCaptcha
    • Reward
      • Reward Status
      • Advanced Reward Options
      • Transactions
    • Analytics
      • Active Visitors
      • Subscribers
      • Sources
      • Shares
      • Devices
      • Unsubscribers
    • Misc
      • Memorable referral links
      • 1-Click Signup
      • Forward & Refer
      • Coupon Codes
      • Custom Attribution
  • Integrate
    • Embeddable Widgets
      • Custom Domain
    • Integrations
      • Active Campaign
      • Aweber
      • Blockchain
      • Facebook Pixel
      • Calendly
      • Discord
      • HubSpot
      • Intercom
      • KakaoTalk
      • Klaviyo
      • Mailchimp
      • Salesforce
      • SendLane
      • Slack
      • Stripe
      • Tango Card
      • Telegram
      • Tremendous
      • Twilio
      • Typeform
      • Webhooks
      • Zapier
      • Zoho
    • Platform-specific Instructions
      • Google Tag Manager
      • WordPress
      • Webflow
      • SquareSpace
      • ClickFunnels
      • Unbounce
      • Instapage
      • Shopify
      • Carrd
      • WIX
    • Javascript Web API
      • Getting Started
      • Configuration file
      • Callbacks
      • Add a subscriber
      • Add a Pending Referral
      • Track multi-step conversion events
      • Track Transaction
      • Identify a Subscriber
      • Identify a Referrer
      • Generate Dashboard Widget
      • Generate Sharing-Screen
    • ReactJS
    • REST API
      • Errors
      • Webhooks
      • Objects
      • Endpoint Reference
    • Mobile SDKs
      • iOS SDK
        • Getting Started
        • Public Methods
        • Public Classes
        • API Interaction Methods
      • Android SDK
        • Getting Started
        • Public Methods
        • Public Classes
        • Listeners & Interfaces
      • Flutter SDK
        • Getting Started
        • Public Methods
      • React Native
        • Getting Started
        • Public Methods
        • Mobile App Testing in Development Mode
      • Mobile App Testing in Development Mode
  • API Tutorials
Powered by GitBook
On this page
  • 1. ReferralParams
  • 2. Subscriber Data
  • 3. List Subscriber Data

Was this helpful?

  1. Integrate
  2. Mobile SDKs
  3. Android SDK

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.

ReferralParams Kotlin Code:

class ReferralParams {
   var transactionId: String? = null
   var conversionCategory: String? = null
   var conversionValue: Int? = null
   var device: String? = null
   var source: String? = null
   var doubleOptIn: Boolean? = null
   var points: Int? = null
   var referrer: String? = null
   var extraField2: String? = null
   var extraField: String? = null
   var name: String? = null
   var uuid: String? = null
   var subscriber_id: String? = null
   var email: String? = null
   var domain: String? = null
   var phoneNumber: String? = null
   var cryptoWalletAddress: String? = null
   var ipAddress: String? = null
   var osType: String? = null
   var screenSize: String? = null
   var social: String? = null

}

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
)
PreviousPublic MethodsNextListeners & Interfaces

Last updated 1 year ago

Was this helpful?