SDK Documentation
Overview of all the SDK features available
Primary Screens
Offers Screen
To open offers a screen for users.
Flyy.navigateToOffersActivity(context);
Flyy.navigateToOffersActivity(context)
Rewards Screen
To open rewards screen for users.
Flyy.navigateToRewardsActivity(context);
Flyy.navigateToRewardsActivity(context)
Wallet Screen
To open wallet screen for user.
Flyy.navigateToWalletActivity(context);
Flyy.navigateToWalletActivity(context)
Additional Screens
Gift Cards Screen
To open gift cards screen for user.
Flyy.navigateToGiftCardsActivity(context);
Flyy.navigateToGiftCardsActivity(context)
Referral History Screen
To open referral history screen for user.
Flyy.navigateToReferralHistoryActivity(context);
Flyy.navigateToReferralHistoryActivity(context)
Quiz Screen
To open quiz screen for user.
Flyy.navigateToQuizActivity(context, 0);
//live quiz_id or 0
Flyy.navigateToQuizActivity(context, 0)
//live quiz_id or 0
Quiz History Screen
To open quiz history screen for user.
Flyy.navigateToQuizHistoryActivity(context);
Flyy.navigateToQuizHistoryActivity(context)
Quiz List Screen
To open quiz list screen for the user.
Flyy.navigateToQuizListActivity(context);
Flyy.navigateToQuizListActivity(context)
Stamps Screen
To open stamps screen for user.
Flyy.navigateToStampActivity(context);
Flyy.navigateToStampActivity(context)
Invite Detail Screen
To open the invite detail screen for user.
Flyy.navigateToInviteDetailActivity(context, 2);
//offer_id can be null
Flyy.navigateToInviteDetailActivity(context, 2)
//offer_id can be null
Invite And Earn Screen
To open the invite and earn screen for the user.
Flyy.navigateToInviteAndEarnActivity(context, 2);
//offer_id can be null
Flyy.navigateToInviteAndEarnActivity(context, 2);
//offer_id can be null
Custom Invite and Earn Screen
To open a custom invite and earn screen for the user.
//offer_id can be null
//tool bar items default color will be black if color is not passed
Flyy.navigateToCustomInviteAndEanActivity(context, 2, "#ffffff");
//offer_id can be null
//tool bar items default color will be black if color is not passed
Flyy.navigateToCustomInviteAndEanActivity(context, 2, "#ffffff")
Challenge Details Screen
To open the challenge details screen for the user.
Flyy.navigateToChallengeDetailActivity(context, 2);
//offer_id can be null
Flyy.navigateToChallengeDetailActivity(context, 2)
//offer_id can be null
Bonanza Screen
To open a bonanza details screen for user.
Flyy.navigateToBonanzaActivity(context);
Flyy.navigateToBonanzaActivity(context)
Raffle Screen
To open the raffle details screen for the user.
Flyy.navigateToRaffleDetailActivity(context, raffleId);
Flyy.navigateToRaffleDetailActivity(context, raffleId)
Additional Methods
Set Theme Colors
The Flyy SDK inherits theme colors which are provided to the setThemeColor
method. The setThemeColor
method must be called immediately after the init
method is called.
//Parameters to be passed are colorPrimary and colorPrimaryDark
Flyy.setThemeColor("#FF5733", "#842C19");
//Parameters to be passed are colorPrimary and colorPrimaryDark
Flyy.setThemeColor("#FF5733", "#842C19")
Set Name
This will be shown in the screens wherever username is displayed.
Flyy.setUsername("<user_name>");
Flyy.setUsername("<user_name>")
SDK Initialization with referral callback
Initialize sdk in your application or main entry point of the app with referral callback as shown below.
//For Production
Flyy.init(getApplicationContext(), "{partner_id}", Flyy.PRODUCTION, new FlyyReferrerDataListener() {
@Override
public void onReferrerDataReceived(String referrerData) {
// TODO do your work here
}
});
//For Staging
Flyy.init(getApplicationContext(), "{partner_id}", Flyy.STAGE, new FlyyReferrerDataListener() {
@Override
public void onReferrerDataReceived(String referrerData) {
// TODO do your work here
}
});
//For Production
Flyy.init(applicationContext, "{partner_id}", Flyy.PRODUCTION, object : FlyyReferrerDataListener {
override fun onReferrerDataReceived(p0: String?) {
// TODO do your work here
}
override fun onReferralCodeWithDataReceived(p0: Array<out String>?) {
}
})
//For Staging
Flyy.init(applicationContext, "{partner_id}", Flyy.STAGING, object : FlyyReferrerDataListener {
override fun onReferrerDataReceived(p0: String?) {
// TODO do your work here
}
override fun onReferralCodeWithDataReceived(p0: Array<out String>?) {
}
})
Set User Token
To increase security for your users you can set a unique user token in the following manner instead of setUser()
method.
///without callback
Flyy.setUserToken("BSt4Y3A2"); //pass your user token
///without callback
Flyy.setUserToken("BSt4Y3A2") //pass your user token
Set User Token along with Segment ID
To increase security for your users you can set unique user token along with segment id in the following manner instead of setUser() method.
//without callback
Flyy.setUserToken("BSt4Y3A2", "all_users");
//without callback
Flyy.setUserToken("BSt4Y3A2", "all_users")
Set New User Token
To increase security for your users you can set unique new user token for new registered users in the following manner instead of setNewUser() method
Flyy.setNewUserToken("QWt4Y3A2"); //pass your new user token
Flyy.setNewUserToken("QWt4Y3A2") //pass your new user token
Set New User Token along with Segment ID
To increase security for your users you can set unique new user token for new registered users along with segment id in the following manner instead of setNewUser() method.
//without callback
Flyy.setNewUserToken("QWt4Y3A2", "all_users");
//without callback
Flyy.setNewUserToken("QWt4Y3A2", "all_users")
Set Bank Details
You can use the following method to set user redemption details, which takes following params,
- Account number - bank account number
- IFSC code
- Name
Flyy.setBankDetails("0000xxxxxxxxxx16", "BSxxxxxxx0", "Pooja");
Flyy.setBankDetails("0000xxxxxxxxxx16", "BSxxxxxxx0", "Pooja")
Set UPI Details
You can use the following method to set user redemption details, which takes following params,
- UPI ID
Flyy.setUPI("user@upiId");
Flyy.setUPI("user@upiId")
Send Events
Sending User Event with API
The
sendEvent
method should only be used for testing on the Staging environment.
For production, use the Sending User Event API call from your backend instead. AllsendEvent
events generating from the front-end are ignored by the Flyy's reward system.
Values can either be sent in the form of key and value or as a json object.
Flyy.sendEvent("profile_updated", "true");
//OR
Flyy.sendEvent("registration", <jsonObject>);
Flyy.sendEvent("profile_updated", "true")
//OR
Flyy.sendEvent("registration", <jsonObject>)
Set Referral Code
To set referral code, please call the following function
Flyy.setReferrerCode("sdfhyr6");
Flyy.setReferrerCode("sdfhyr6")
Get Referral Code
To get a referral code, please call the following function
Flyy.getReferrerCode();
Flyy.getReferrerCode()
Verify Referral Code
To verify if referral code is valid or not, please call the following function
Flyy.verifyReferralCode(this, "sdfhyr6", new FlyyVerifyReferralCode() {
@Override
public void isReferralCodeValid(boolean isValid, String referralCode) {
if (isValid) {
Log.d(TAG, "isReferralCodeValid: " + referralCode);
}
}
});
Flyy.verifyReferralCode(this, "sdfhyr6", object : FlyyVerifyReferralCode {
override fun isReferralCodeValid(isValid: Boolean, referralCode: String?) {
if (isValid) {
Log.d(TAG, "isReferralCodeValid: " + referralCode)
}
}
})
Show the Notification Popup
Use the below code to show a default Flyy notification popup. You can keep the notificaiton_id and campaign_id 0/-1 if you don't have one.
Flyy.showPopup(getApplicationContext(), notification_id, "title", "message", "big_image", "deeplink", campaign_id);
Flyy.showPopup(applicationContext, notification_id, "title", "message", "big_image", "deeplink", campaign_id)
Show Reward Won Popup
Use the below code to show the reward won popup.
Flyy.showRewardWonPopup(
"title", "message", "deeplink", "buttonText", showConfetti);
//showConfetti is a boolean value
Flyy.showRewardWonPopup(
"title", "message", "deeplink", "buttonText", showConfetti)
//showConfetti is a boolean value
Show Reward Won Scratch Card Popup
Use the below code to show the reward won scratch card popup.
Flyy.showRewardWonScratchPopup(
"title", "message", showConfetti, "refNum");
//showConfetti is a boolean value
Flyy.showRewardWonScratchPopup(
"title", "message", showConfetti, "refNum")
//showConfetti is a boolean value
Get Share Data
Use the below code to get share data.
Flyy.getShareData(this, new FlyyReferralDataFetchedListener() {
@Override
public void onReferralDetailsFetched(FlyyReferralDetails referralDetails) {
}
@Override
public void onFailure(String failureMessage) {
}
});
Flyy.getShareData(this, object : FlyyReferralDataFetchedListener {
override fun onReferralDetailsFetched(referralDetails: FlyyReferralDetails) {
}
override fun onFailure(failureMessage: String) {
}
})
Get Referral Count
Use the below code to get referral count.
Flyy.getReferralCount(this, new FlyyReferralCountFetchedListener() {
@Override
public void onReferralCountFetched(int referralsCount) {
}
@Override
public void onFailure(String failureMessage) {
}
});
Flyy.getReferralCount(this, object : FlyyReferralCountFetchedListener {
override fun onReferralCountFetched(referralsCount: Int) {
}
override fun onFailure(failureMessage: String) {
}
})
Get Scratch Card Count
Use the below code to get scratch card count.
Flyy.getScratchCardCount(this, new FlyyFetchScratchCardCountListener() {
@Override
public void onSuccess(FlyyScrachCardCount flyyScrachCardCount) {
}
@Override
public void onFailure(String message) {
}
});
Flyy.getScratchCardCount(this, object : FlyyFetchScratchCardCountListener {
override fun onSuccess(flyyScrachCardCount: FlyyScrachCardCount) {
}
override fun onFailure(message: String) {
}
})
Get Previous Leaderboard Winner
Use the below code to get previous leaderboard winners.
//Provide tag to fetch a specific Leaderboard
Flyy.getPreviousLeaderboardWinners(this, "{tag}", new FlyyFetchLeaderboardDataListner() {
@Override
public void onSuccess(FlyyLeaderboardData flyyLeaderboardData) {
}
@Override
public void onFailure(String message) {
}
});
//Provide tag to fetch a specific Leaderboard
Flyy.getPreviousLeaderboardWinners(this, "{tag}", object : FlyyFetchLeaderboardDataListner {
override fun onSuccess(flyyLeaderboardData: FlyyLeaderboardData) {
}
override fun onFailure(message: String) {
}
Get Leaderboard Participants
Use the below code to get leaderboard participants.
//Provide tag to fetch a specific Leaderboard
Flyy.getLeaderboardParticipants(this, "{tag}", new FlyyFetchLeaderboardDataListner() {
@Override
public void onSuccess(FlyyLeaderboardData flyyLeaderboardData) {
}
@Override
public void onFailure(String message) {
}
});
//Provide tag to fetch a specific Leaderboard
Flyy.getLeaderboardParticipants(this, "{tag}", object : FlyyFetchLeaderboardDataListner {
override fun onSuccess(flyyLeaderboardData: FlyyLeaderboardData) {
}
override fun onFailure(message: String) {
}
})
Get Wallet Balance
Use the below code to get wallet balance.
Flyy.getWalletBalance(this, "Cash", new FlyyFetchWalletDataListener() {
@Override
public void onSuccess(FlyySpecificWalletData flyySpecificWalletData) {
}
@Override
public void onFailure(String message) {
}
});
Flyy.getWalletBalance(this, "Cash", object : FlyyFetchWalletDataListener {
override fun onSuccess(flyySpecificWalletData: FlyySpecificWalletData) {
}
override fun onFailure(message: String) {
}
})
Get Referrer Details
Use the below code to get referrer details.
Flyy.getReferrerDetails(this, new FlyyFetchReferrerDetailsListener() {
@Override
public void onSuccess(FlyyReferrerDetails flyyReferrerDetails) {
}
@Override
public void onFailure(String message) {
}
});
Flyy.getReferrerDetails(this, object : FlyyFetchReferrerDetailsListener {
override fun onSuccess(flyyReferrerDetails: FlyyReferrerDetails) {
}
override fun onFailure(message: String) {
}
})
Get Offers Count
Use the below code to get the offers count.
Flyy.getOffersCount(this, new FlyyFetchOffersCountListener() {
@Override
public void onSuccess(FlyyOffersCount flyyOffersCount) {
}
@Override
public void onFailure(String message) {
}
});
Flyy.getOffersCount(this, object : FlyyFetchOffersCountListener {
override fun onSuccess(flyyOffersCount: FlyyOffersCount) {
}
override fun onFailure(message: String) {
}
})
Advanced Implementation
Get SDK Closed Listener
To get flyy sdk closed listener
Flyy.getFlyySDKClosed(new FlyySDKClosedListener() {
@Override
public void onSDKClosed() {
//do your work here
}
});
Flyy.getFlyySDKClosed(FlyySDKClosedListener {
//do your work here
})
Add User to a Segment
To add a user to a specific segment. If you are adding a user to an existing segment, you can pass null in segment_title. If the user segment is not present it will create a new one
Flyy.addUserToSegment(segment_title, segment_key);
Flyy.addUserToSegment(segment_title, segment_key)
Get Screen Visits data
Use the below code to get the following data:-
[“home_checkin_clicked”, “offer_card_clicked”, “game_card_clicked”, “quiz_card_clicked”, “stamp_campaign_card_clicked”, “leaderboard_card_clicked”, “checkin_card_clicked”, “challenges_card_clicked”, “raffle_card_clicked”, “transaction_screen_visited”, “detail_checkin_clicked”, “referrals_screen_visited”, “rewards_screen_visited”, “wallet_screen_visited”]
Flyy.trackUIEvents(new FlyyUIEventsListener() {
@Override
public void onEventDone(FlyyUIEvent flyyUIEvent) {
}
});
Flyy.trackUIEvents {
//do your work here
}
Change the Confetti Colors
Use the below code to change the confetti color which gets shown when you win a ScratchCard. It will throw an IllegalArgumentException if the passed color string is incorrect.
List<FlyyColor> flyyConfettiColorList = new ArrayList<>();
flyyConfettiColorList.add(new FlyyColor("#ABABAB"));
flyyConfettiColorList.add(new FlyyColor("#F0987D"));
flyyConfettiColorList.add(new FlyyColor("#BFCADE"));
Flyy.setConfettiColors(flyyConfettiColorList);
val flyyConfettiColorList: MutableList<FlyyColor> = ArrayList()
flyyConfettiColorList.add(FlyyColor("#ABABAB"))
flyyConfettiColorList.add(FlyyColor("#F0987D"))
flyyConfettiColorList.add(FlyyColor("#BFCADE"))
Flyy.setConfettiColors(flyyConfettiColorList)
Set Custom Domain
Use the below code to set the custom Domain name for Flyy SDK. Ensure you do not add https:// with the Domain.
Flyy.setBaseFlyyDomain("www.xyz.com");
Flyy.setBaseStageFlyyDomain("www.xyz.com");
Flyy.setBaseFlyyDomain("www.xyz.com")
Flyy.setBaseStageFlyyDomain("www.xyz.com")
Updated about 2 years ago