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
  • RHReferralCallBackListener
  • RHMyReferralCallBackListener
  • RHLeaderboardReferralCallBackListener
  • RHRewardsCallBackListener

Was this helpful?

  1. Integrate
  2. Mobile SDKs
  3. Android SDK

Listeners & Interfaces

ReferralHero Kotlin / Java SDK

ReferralHero provides various interfaces with its SDK that can be used to receive a callback upon successful execution, or in case of some error while executing the API.

You can use these callbacks to:

  • Track the execution of the API

  • Check if the API call is successful or not

  • Receive API response data or some other data depending on the API

  • Get error message in case the API call fails

RHReferralCallBackListener

Callback interface for when the AddSubscriber, UpdateSubscriber, and also use in other API finishes execution.

This interface is used to receive a callback while updating Subscriber detail and status.

There are 2 methods in this Listener like success and failure methods

fun onSuccessCallback(response: String?)
fun onFailureCallback(response: String?)

onSuccessCallback method call, when the API finishes execution With success if api execution finishes with exception it will call onFailureCallback.

Parameters

response – String check below response for reference

Subscriber Data Class Sample Response

{
    "status": "ok",
    "data": {
        "id": "sub_8645f85ac894",
        "name": "Test User 10",
        "email": "test10@gmail.com",
        "phone_number": "",
        "crypto_wallet_address": "",
        "crypto_wallet_provider": "",
        "extra_field": "",
        "extra_field_2": "",
        "option_field": "",
        "conversion_amount": 0,
        "code": "3ab0f674",
        "position": 10,
        "referred": false,
        "referred_by": {},
        "people_referred": 0,
        "promoted": false,
        "promoted_at": null,
        "verified": true,
        "verified_at": 1684403108,
        "points": 0,
        "risk_level": 0,
        "host": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxxxx/analytics/traffic",
        "source": null,
        "device": null,
        "status":"",
        "referral_link": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxxxx/analytics/traffic?mwr=3ab0f674",
        "created_at": 1684403108,
        "last_updated_at": 1684403108,
        "response": "subscriber_created"
    },
    "calls_left": null,
    "timestamp": 1684403108
}

RHMyReferralCallBackListener

Callback interface for when the Get My Referral API finishes execution.

This interface is used to receive a callback while retrieving my Referral details.

There are 2 methods in this Listener like success and failure methods

fun onMyReferralSuccessCallback(response: String?)
fun onMyReferralFailureCallback(response: String?)

onMyReferralSuccessCallback method call, when the API finishes execution With success if api execution finishes with exception it will call onMyReferralFailureCallback.

Parameters

response– ApiResponse<ListSubscriberData> check below response for reference

Get My Referral Sample Response

{
  "status": "ok",
  "data": {
    "response": "subscribers_retrieved",
    "subscribers": [
      {
        "id": "sub_fa49ba0d30e9",
        "name": "Test User 10",
        "email": "test125@gmail.com",
        "phone_number": "",
        "crypto_wallet_address": "",
        "crypto_wallet_provider": "",
        "extra_field": "",
        "extra_field_2": "",
        "option_field": "",
        "conversion_amount": 0,
        "code": "dededb46",
        "position": 20,
        "referred": true,
        "referred_by": {
          "id": "sub_d0cc231dce89",
          "name": "Test name",
          "email": "test26@gmail.com",
          "code": "0879561f",
          "people_referred": 1,
          "points": 0
        },
        "people_referred": 0,
        "promoted": false,
        "promoted_at": null,
        "verified": true,
        "verified_at": 1684985427,
        "points": 0,
        "risk_level": 0,
        "host": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxxxx/analytics/traffic",
        "source": null,
        "device": null,
        "referral_link": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxxxxx/analytics/traffic?mwr=dededb46",
        "created_at": 1684985427,
        "last_updated_at": 1684985427
      }
    ],
    "pagination": {
      "total_pages": 1,
      "current_page": 1,
      "per_page": 50,
      "total_objects": 1
    }
  },
  "calls_left": null,
  "timestamp": 1685012334
}

RHLeaderboardReferralCallBackListener

Callback interface for when the Get My Referral API finishes execution.

This interface is used to receive a callback while retrieving my Referral details.

There are 2 methods in this Listener like success and failure methods

fun onLeaderboardReferralSuccessCallback(response: String?)
fun onLeaderboardReferralFailureCallback(response: String?)

onLeaderboardReferralSuccessCallback method call, when the API finishes execution With success if api execution finishes with exception it will call onLeaderboard ReferralFailureCallback.

Parameters

response– ApiResponse<RankingDataContent> check below response for reference

Get Leaderboard Sample Response

{
  "status": "ok",
  "data": {
    "ranking": [
      {
        "id": "sub_7b9be1ed8ccb",
        "name": "Test User 10",
        "email": "test15@gmail.com",
        "phone_number": "",
        "crypto_wallet_address": "",
        "crypto_wallet_provider": "",
        "extra_field": "",
        "extra_field_2": "",
        "option_field": "",
        "conversion_amount": 0,
        "code": "2c2dbefb",
        "position": 1,
        "referred": false,
        "referred_by": {
          
        },
        "people_referred": 0,
        "promoted": false,
        "promoted_at": null,
        "verified": true,
        "verified_at": 1685018462,
        "points": 0,
        "risk_level": 0,
        "host": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxxxx/analytics/traffic",
        "source": null,
        "device": null,
        "status":"",
        "referral_link": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxxx/analytics/traffic?mwr=2c2dbefb",
        "created_at": 1685018462,
        "last_updated_at": 1685020506
      },
      {
        "id": "sub_06e2af5a2236",
        "name": "Test User multi1",
        "email": "testorganic3@gmail.com",
        "phone_number": "",
        "crypto_wallet_address": "",
        "crypto_wallet_provider": "",
        "extra_field": "",
        "extra_field_2": "",
        "option_field": "",
        "conversion_amount": 0,
        "code": "afd54225",
        "position": 2,
        "referred": false,
        "referred_by": {
          
        },
        "people_referred": 0,
        "promoted": false,
        "promoted_at": null,
        "verified": true,
        "verified_at": 1685018562,
        "points": 0,
        "risk_level": 0,
        "host": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxx/analytics/traffic",
        "source": null,
        "device": null,
        "status":"",
        "referral_link": "https://app.referralhero.com/dashboard/lists/MFxxxxxxxx/analytics/traffic?mwr=afd54225",
        "created_at": 1685018562,
        "last_updated_at": 1685018562
      }
    ],
    "count": 2
  },
  "calls_left": null,
  "timestamp": 1685020750
}

RHRewardsCallBackListener

Callback interface for when the Get Rewards API finishes execution.

This interface is used to receive a callback while retrieving my Referral details.

There are 2 methods in this Listener like success and failure methods

fun onRewardsSuccessCallback(response: String?)
fun onRewardsFailureCallback(response: String?)

onRewardsSuccessCallback method call, when the API finishes execution With success if api execution finishes with exception it will call onRewardsFailureCallback.

Parameters

response– ApiResponse<ListSubscriberData> check this response for reference

Get Rewards Sample Response

{
    "status": "ok",
    "data": {
        "response": "rewards_retrieved",
        "rewards": [
            {
                "id": 1795,
                "name": "A free Premium account for 1 year",
                "status": "confirmed",
                "referrals": null,
                "created_at": 1686397951,
                "signup_type": "organic subscriber",
                "referrals_type": null,
                "recurring_count": null,
                "image_url": null
            }
        ],
        "pagination": {
            "total_pages": 1,
            "current_page": 1,
            "per_page": 10,
            "total_objects": 1
        }
    },
    "calls_left": null,
    "timestamp": 1687759997
}
PreviousPublic ClassesNextFlutter SDK

Last updated 2 months ago

Was this helpful?