Use the Loyalty Management Mobile SDK Sample App

The MyNTORewards sample apps are a reference implementation of Loyalty Management Mobile SDK capabilities, and include the SDK's code, structure, and implementation. You can either implement the source code provided with the sample app in your existing code as-is or extend the capabilities of the code by modifying the code.
After ensuring you have the necessary development tools, dependencies, and the SDK installed, integrate the Loyalty Management Mobile SDK sample app code in your iOS or Android project:
  1. Go to the location from where you downloaded the iOS or Android SDK, and select SampleApps | MyNTORewards.
  2. From the Sample Apps project, copy the files that you want to reuse in your project.
  3. Open an existing or new project in Xcode or Android Studio, and create a class or file.
  4. Paste the files that you copied from the MyNTORewards sample apps.
  5. Import any necessary dependencies that are used within.
  6. Modify the code as per your requirements.
  7. Test your app after you add the sample app code in iOS or Android.

Example

For example, consider the source code for the class, CommunityMemberModel:

1package com.salesforce.loyalty.mobile.myntorewards.utilities
2
3data class CommunityMemberModel(
4    val firstName: String?,
5    val lastName: String?,
6    val email: String?,
7    val loyaltyProgramMemberId: String?,
8    val loyaltyProgramName: String?,
9    val membershipNumber: String?
10)

You can use the CommunityMemberModel class to represent the community member information as per your app. For example, you can create instances of this class to store member data:

1val member = CommunityMemberModel(
2    firstName = "Adam",
3    lastName = "Smith",
4    email = "adamsmith@example.com",
5    loyaltyProgramMemberId = "123456",
6    loyaltyProgramName = "NTO Insider Loyalty Program",
7    membershipNumber = "78190"
8)

You can modify the code provided with the sample app in the SDK to extract and store member data:

1val firstName = member.firstName
2val lastName = member.lastName
3val email = member.email
4val loyaltyProgramName = member.loyaltyProgramName