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
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
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
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