Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Use the Loyalty Management Mobile SDK Sample App
- Go to the location from where you downloaded the iOS or Android SDK, and select .
- From the Sample Apps project, copy the files that you want to reuse in your project.
- Open an existing or new project in Xcode or Android Studio, and create a class or file.
- Paste the files that you copied from the MyNTORewards sample apps.
- Import any necessary dependencies that are used within.
- Modify the code as per your requirements.
- 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