Integrate Gamification Mobile Android SDK into Loyalty Management Mobile Android SDK
To integrate the Gamification Mobile Android SDK into the existing Loyalty Management Mobile Android SDK, add it as an external dependency.
| Required Editions |
|---|
| Available in: all editions that have Loyalty Management enabled |
-
Open Terminal, and go to the
LoyaltyMobileSDK-Androidfolder. -
Run these commands:
git submodule add git@github.com:loyaltysampleapp/GamificationMobileSDK-Android.gitgit submodule syncgit submodule updatecd GamificationMobileSDK-Androidgit submodule update --init --recursive --remote -
Open the
LoyaltyMobileSDK-Androidproject in Android Studio. -
Click Open.
-
Open the
SampleApps/MyNTORewards/build.gradlefile, and under Dependencies block, to the first line of Dependencies, add:implementation(project(":GamificationMobileSDK-Android:GamificationMobileSDK")) -
Open the
SampleApps/MyNTORewards/connectedapp.properties.samplefile 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.
If the sync fails, disconnect the VPN to ensure there’s no blocker when downloading the dependencies, and then resync.
-
To add the gamification SDK package, include this code snippet in your code.
`import com.salesforce.gamification.api.*import com.salesforce.gamification.model.*import com.salesforce.gamification.repository.*import com.salesforce.gamification.utilities.*`
You can now use the classes and interfaces in the GamificationMobileSDK-Android module to extend and manage the gamification features in the MyNTORewards sample app.