Referral Customization for Android

After you build the Referral Mobile SDK for Android, you can customize the referral UI components, and modify the referral-related configuration in the MyNTORewards sample app.

The referral UI components are available in the /LoyaltyMobileSDK-Android/SampleApps/MyNTORewards/src/main/java/com/salesforce/loyalty/mobile/myntorewards/views/components package.

For example, to include the Gmail icon as one of the sharing options in the app:

  • Add the new Gmail icon in the LoyaltyMobileSDK-Android/SampleApps/MyNTORewards/src/main/res/drawable folder.
  • Open the LoyaltyMobileSDK-Android/SampleApps/MyNTORewards/src/main/java/com/salesforce/loyalty/mobile/myntorewards/utilities/ShareType.kt file in Android Studio, and add an entry for Gmail that contains the new icon ID, the Gmail package name, and the INTENT_TYPE_MAIL constant inside the ShareType enum class.

You can modify the referral program details in the LoyaltyMobileSDK-Android/SampleApps/MyNTORewards/src/main/java/com/salesforce/loyalty/mobile/myntorewards/referrals/ReferralConfig.kt file.

Here are all the properties you can modify.

  • REFERRAL_DEFAULT_PROMOTION_CODE and REFERRAL_DEFAULT_PROMOTION_ID: The default promotion code and ID.
  • REFERRAL_DURATION: The period in days for which the referral details are to be displayed. By default, the sample app shows the referral information of the last 90 days.
  • REFERRAL_PROGRAM_NAME: The default referral program name.
  • REFERRAL_TANDC_LINK: An external Terms and Conditions link.

For a complete walkthrough of the referral feature in the MyNTORewards app, see Walkthrough of the Sample App.

An advocate can refer a friend only once. When an advocate makes repeated attempts to refer a friend, you can show a custom message based on your company’s branding.