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 |
- Open Terminal, and go to the LoyaltyMobileSDK-Android folder.
-
Run these commands:
git submodule add git@github.com:loyaltysampleapp/ReferralMobileSDK-Android.gitgit submodule syncgit submodule updatecd ReferralMobileSDK-Androidgit submodule update --init --recursive --remote
- Open the LoyaltyMobileSDK-Android project in Android Studio.
- Click Open.
-
Open the SampleApps/MyNTORewards/build.gradle file, and under
Dependencies block, to the first line of Dependencies, add:
implementation(project(":ReferralMobileSDK-Android:ReferralMobileSDK"))
- Open the SampleApps/MyNTORewards/connectedapp.properties file and modify the properties of the connected app as per your org.
- Click Sync Now.
-
Open the SDK files and ensure that the files include the appropriate SDK
packages.
-
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.