Referral Customization for iOS
After you build the Referral Mobile SDK for iOS, you can customize the referral UI
components, and modify the referral-related configuration in the MyNTORewards sample app.
UI Customization
The referral UI components are available in LoyaltyMobileSDK-iOS/SampleApps/MyNTORewards/MyNTORewards/Referral/Views.
For example, to include Gmail as one of the options to share a referral code:
- Add the new Gmail icon in the LoyaltyMobileSDK-iOS/SampleApps/MyNTORewards/MyNTORewards/Assets.xcassets folder.
- Open the LoyaltyMobileSDK-iOS/SampleApps/MyNTORewards/MyNTORewards/Referral/Views/ReferAFriendView.swift file in Xcode, and add the new icon ID to the list of icon IDs.
1HStack("spacing":15){
2 "Button"{
3 "showShareSheet.toggle()"
4 }"label":{
5 "Image(""ic-fb"")"
6 }".sheet(isPresented":"$showShareSheet)"{
7 "ActivityViewController(activityItems":[
8 "shareText"
9 ]")"
10 }"Button"{
11 "showShareSheet.toggle()"
12 }"label":{
13 "Image(""ic-ig"")"
14 }".sheet(isPresented":"$showShareSheet)"{
15 "ActivityViewController(activityItems":[
16 "shareText"
17 ]")"
18 }"Button"{
19 "shareToWhatsApp(text":"shareText)"
20 }"label":{
21 "Image(""ic-whatsapp"")"
22 }"Button"{
23 "shareToTwitter(text":"shareText)"
24 }"label":{
25 "Image(""ic-twitter"")"
26 }"Button"{
27 "shareToGmail(text":"shareText)"
28 }"label":{
29 "Image(""ic-gmail"")"
30 }"Button"{
31 "showShareSheet.toggle()"
32 }"label":{
33 "Image(""ic-share"")"
34 }Settings Customization
You can modify the referral program details in the LoyaltyMobileSDK-iOS/SampleApps/SampleApps/MyNTORewards/MyNTORewards/AppSettings.swift file.
Here are all the properties you can modify.
1// Referral settings
2static let referralProgramName = loyaltyProgramName
3// Configure the referral promotion details below, where a user can enroll and refer from the My Referrals screen
4static let promotionCode = "TEMPRP7"
5static let referralDateFormat = "yyyy-MM-dd'T'HH:mm:ss"
6static let referralDateFormatWithoutTime = "yyyy-MM-dd"
7/* Provided an example link here instead of the actual Terms and Conditions link.
8Replace with valid terms and conditions link while using the feature */
9static let referralTermsLink = "https://www.google.com"- promotionCode: The default promotion code.
- referralDateFormat and referralDateFormatWithoutTime: The referral activity date format with and without time.
- referralProgramName: The default referral program name.
- referralTermsLink: An external Terms and Conditions link.
For a complete walkthrough of the referral feature in the MyNTORewards app, see Walkthrough of the Sample App.