These docs are for v1.2.0. Click to read the latest docs for v1.2.5.

SDK Documentation

Overview of all the SDK features available

Offers Screen

To open offers a screen for users with or without segment id.

Flyy.navigateToOffersActivity(context);
FlyyFlutterPlugin.openFlyyOffersPage();
Flyy.sharedInstance.openOffersPage()
Flyy.openOffersScreen();
[flyy openOffersPage];

Rewards Screen

To open rewards screen for users.

Flyy.navigateToRewardsActivity(context);
Something();
Swift

Wallet Screen

To open wallet screen for user.

Flyy.navigateToWalletActivity(context);

Additional Screens

Gift Cards Screen

To open gift cards screen for user.

Flyy.navigateToGiftCardsActivity(context);

Referral History Screen

To open referral history screen for user.

Flyy.navigateToReferralHistoryActivity(context);

Quiz Screen

To open quiz screen for user.

Flyy.navigateToQuizActivity(context, 0);
//live quiz_id or 0

Quiz History Screen

To open quiz history screen for user.

Flyy.navigateToQuizHistoryActivity(context);

Quiz List Screen

To open quiz list screen for user.

Flyy.navigateToQuizListActivity(context);

Stamps Screen

To open quiz list screen for user.

Flyy.navigateToStampActivity(context);

Invite Detail Screen

To open the invite detail screen for user.

Flyy.navigateToInviteDetailActivity(this, 2);
//offer_id can be null

Invite And Earn Screen

To open the invite and earn screen for the user.

Flyy.navigateToInviteAndEarnActivity(this, 2);
//offer_id can be null

Custom Invite and Earn Screen

To open a custom invite and earn screen for the user.

Flyy.navigateToCustomInviteAndEanActivity(this, 2, “#ffffff”);
//offer_id can be null
//tool bar items default color will be black if color is not passed

Challenge Details Screen

To open the challenge details screen for the user.

Flyy.navigateToChallengeDetailActivity(this, 2);
//offer_id can be null

Bonanza Screen

To open a bonanza details screen for user.

Flyy.navigateToBonanzaActivity(this);

Raffle Screen

To open the raffle details screen for the user.

Flyy.navigateToRaffleDetailActivity(this, 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");

Set Name

This will be shown in the screens wherever username is displayed.

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
   }
});

Set User Token

To increase security for your users you can set unique user token in the following manner instead of setUser() method.

///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");

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

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");

Set Bank Details

You can use the following method to set user redemption details, which takes following params,

  1. Account number - bank account number
  2. IFSC code
  3. Name
Flyy.setBankDetails("0000xxxxxxxxxx16", "BSxxxxxxx0", "Pooja");

Set UPI Details

You can use the following method to set user redemption details, which takes following params,

  1. UPI ID
Flyy.setUPI("user@upiId");

Set Referral Code

To set referral code, please call the following function

Flyy.setReferrerCode("sdfhyr6");

To Verify valid 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);
       }
   }
});

To 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);

To 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

To 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

To 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) {

   }
});

To 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) {

   }
});

To 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) {

   }
});

To get previous leaderboard winner

Use the below code to get previous leaderboard winners.

Flyy.getPreviousLeaderboardWinners(this, new FlyyFetchLeaderboardDataListner() {
   @Override
   public void onSuccess(FlyyLeaderboardData flyyLeaderboardData) {
     
   }

   @Override
   public void onFailure(String message) {

   }
});

To get leaderboard participants

Use the below code to get leaderboard participants.

Flyy.getLeaderboardParticipants(this, new FlyyFetchLeaderboardDataListner() {
   @Override
   public void onSuccess(FlyyLeaderboardData flyyLeaderboardData) {
     
   }

   @Override
   public void onFailure(String message) {

   }
});

To 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) {

   }
});

To 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) {

   }
});

To get offers count

Use the below code to get offers count.

Flyy.getOffersCount(this, new FlyyFetchOffersCountListener() {
   @Override
   public void onSuccess(FlyyOffersCount flyyOffersCount) {
      
   }

   @Override
   public void onFailure(String message) {

   }
});

Advanced Implementation

Get SDK Closed Listener

To get flyy sdk closed listener

Flyy.getFlyySDKClosed(new FlyySDKClosedListener() {
   @Override
   public void onSDKClosed() {
       //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);

To 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) {
     
   }
});

To 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);

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");