Integrate Referral Mobile Android SDK into Loyalty Management Mobile Android SDK

To integrate the Referral Mobile Android SDK into the existing Loyalty Management Mobile Android SDK, add it as an external dependency.
Available in: all editions that have Referral Marketing enabled

  1. Open Terminal, and go to the LoyaltyMobileSDK-Android folder.
  2. Run these commands:
    git submodule add git@github.com:loyaltysampleapp/ReferralMobileSDK-Android.git
    git submodule sync
    git submodule update
    cd ReferralMobileSDK-Android
    git submodule update --init --recursive --remote
  3. Open the LoyaltyMobileSDK-Android project in Android Studio.
  4. Click Open.
  5. Open the SampleApps/MyNTORewards/build.gradle file, and under Dependencies block, to the first line of Dependencies, add:
    implementation(project(":ReferralMobileSDK-Android:ReferralMobileSDK"))
  6. Open the SampleApps/MyNTORewards/connectedapp.properties file and modify the properties of the connected app as per your org.
  7. Click Sync Now.
  8. Open the SDK files and ensure that the files include the appropriate SDK packages.

    If the sync fails, disconnect the VPN to ensure there’s no blocker when downloading the dependencies, and then resync.

    Note

  9. To add the Referral SDK package, include this code snippet in your code.
    `import com.salesforce.referral.api.*
    import com.salesforce.referral.entities.*
    import com.salesforce.referral.repository.*
    import com.salesforce.referral.utils.*`
You can now use the classes and interfaces in the ReferralMobileSDK-Android module to extend and manage the referral program feature in the MyNTORewards sample app.