Q1. How to set Background image?

Ans: You can also set the background image of your choice for the InviteReferrals screen. In order to do so, simply rename your background image as “bg.png” and import it to your project’s Assets or simply drag and include it in your project.

Q2. How to translate the InviteReferrals screen into localized language as per the default language of the iOS device?

Ans: For Localised languages such as Vietnamese follow the following steps :

A. Select your Project in the left panel. You need to select the Project in the next pane (NOT the Target). Now, under the Info tab, you’ll see a section for Localizations, click the + and choose Vietnamese (vi) language.

B. The next screen asks you for the files which you want to localize. Select all the files you want to localize and click Finish. Note: Localizable. strings will not show up in this list, so don’t panic! At this point, Xcode has set up some directories, behind the scenes, containing separate versions of InfoPlist.strings and Main. storyboard for each language that you have selected.

C. Add a new file, Go to File>>New>>File. Choose Strings File under the Resource subsection. Click Next, name the file Localizable. strings, then click on Save.

📘

Note: Localizable. strings is the default filename iOS used for localized text. Resist the urge to name the file something else, otherwise, you will have to type the name of your .strings file each time you refer to a localized string.

D. To let Xcode know you want it localized, select the file using the left pane, and open the File Inspector in the right pane. There you will see a button labeled Localize, click on it, choose English (because it’s currently in English), and finally click Localize.

E. Now ensure that both English and Vietnamese are selected in Localization in the file inspector on the right pane in Xcode.

F. Go back to the left panel and click on the arrow next to Localizable. strings, so it shows the sub-elements. You now have two versions of this file: one for English and the other one for Vietnamese:

G. Select Localizable.strings (English) and replace its contents with the following:

"Done" = "Done";
"OK" = "OK";
"Dismiss" = "Dismiss";
"Connection Lost" = "Connection Lost";
"Please check your network and make sure your device is connected to the internet" = "Please check your network and make sure your device is connected to the internet";
"Error Occurred" = "Error Occurred";
"Something went wrong" = "Something went wrong";
"Please enter your email." = "Please enter your email.";
"Press OK to continue" = "Press OK to continue";
"Please enter a valid email." = "Please enter a valid email.";
"Invalid authentication" = "Invalid authentication";
"Enter your name" = "Enter your name";
"Enter your Email" = "Enter your Email";
"Enter the Referral Program" = "Enter the Referral Program";
"How it works" = "How it works";
"Terms & Conditions" = "Terms & Conditions";
"Facebook not Logged In." = "Facebook not Logged In.";
"Please login to your facebook account first." = "Please login to your facebook account first.";
"Twitter not Logged In." = "Twitter not Logged In.";
"Please login to your twitter account first." = "Please login to your twitter account first.";
"WhatsApp not installed." = "WhatsApp not installed.";
"Your device does not have WhatsApp installed." = "Your device does not have WhatsApp installed.";
"Facebook not installed." = "Facebook not installed.";
"Your device does not have Facebook installed." = "Your device does not have WhatsApp installed.";
"Twitter not installed." = "Twitter not installed.";
"Your device does not have Twitter installed." = "Your device does not have Twitter installed.";
"Can not Send Mail" = "Can not Send Mail";
"Please login to your email account first." = "Please login to your email account first.";
"More options to share" = "More options to share";
"My Referral Statistics" = "My Referral Statistics";
"Sharing link has been copied to clipboard" = "Sharing link has been copied to clipboard";

H. To change the text for Vietnamese, Select Localizable. strings (Vietnamese) and replace its contents with the following:

"Done" = "Làm xong";
"OK" = "được";
"Dismiss" = "Bỏ qua";
"Connection Lost" = "Kết nối bị mất";
"Please check your network and make sure your device is connected to the internet" = "Vui lòng kiểm tra mạng của bạn và đảm bảo thiết bị của bạn được kết nối với internet";
"Error Occurred" = "xảy ra lỗi";
"Something went wrong" = "Đã xảy ra lỗi";
"Please enter your email." ="Vui lòng điền email của bạn .";
"Press OK to continue" = "Nhấn OK để tiếp tục";
"Please enter a valid email." = "Vui lòng nhập email hợp lệ.";
"Invalid authentication" = "xác thực không hợp lệ";
"Enter your name" = "Nhập tên của bạn";
"Enter your Email" = "Nhập email của bạn";
"Enter the Referral Program" = "Nhập Chương trình giới thiệu";
"How it works" = "Làm thế nào nó hoạt động";
"Terms & Conditions" = "Điều khoản và điều kiện";
"Facebook not Logged In." = "Facebook không Logged In.";
"Please login to your facebook account first." = "Xin hãy đăng nhập vào tài khoản facebook của bạn đầu tiên.";
"Twitter not Logged In." = "Twitter không Logged In.";
"Please login to your twitter account first." = "Xin hãy đăng nhập vào tài khoản twitter của bạn đầu tiên .";
"WhatsApp not installed." = "WhatsApp chưa được cài đặt";
"Your device does not have WhatsApp installed." = "Thiết bị của bạn chưa cài đặt WhatsApp";
"Facebook not installed." = "Facebook chưa được cài đặt";
"Your device does not have Facebook installed." = "Thiết bị của bạn chưa cài đặt Facebook";
"Twitter not installed." = "Twitter chưa được cài đặt";
"Your device does not have Twitter installed." = "Thiết bị của bạn chưa cài đặt Twitter";
"Can not Send Mail" = "Không thể Gửi Mail";
"Please login to your email account first." = "Xin hãy đăng nhập vào tài khoản email của bạn đầu tiên .";
"More options to share" = "Nhiều tùy chọn để chia sẻ";
"My Referral Statistics" = "Thống kê giới thiệu của tôi";
"Sharing link has been copied to clipboard" = "Liên kết chia sẻ đã được sao chép vào clipboard";

Q3. How to set custom fonts?

Ans: You can use Custom fonts for InviteReferrals Screens texts to match with your App’s text fonts. To do this Add fonts .ttf files inside the Font folder to your XCode project. Edit info.plist file. Add Fonts provided by the application key into your plist and in Item 0, copy the exact filename of the font that you copied to your XCode project WITH an extension. For example "DroidSans-Bold.ttf".

Make sure that the font you imported to your app is being packed into the app itself. Do that by selecting your Target, then Build Phases, and Copy Bundle Resources. If you don't see your font in there, simply add them by clicking on the " + " sign on the left bottom of the Copy Bundle Resources tab.

Q4. I want to Customise the Navigation Bar used in InviteReferrals screens. How can I do that?

Ans: You can also customize the navigation bar as per your choice for Invitereferrals screens. To do this, simply call the following method inside your first ViewController (or only once before triggering the “launch” method of SDK), the view did load method.

InviteReferrals.setDefaultNavigationController(UINavigationController?, barStyle: UIBarStyle, preferedStatusBarStyleLightContent: true/false, barSetTranslucent: true/false, barLoginScreenTitle: "Login Screen Title", barShareScreenTitle: "Share Screen Title", barInActiveCampaignScreenTitle: "InActive Campaign Screen Title", barTitleTextAttributes: [NSAttributedString.Key : Any]?, barTitleColor: "rgba()/#HexColorCode/nil", barBackground: "rgba(227,188,99,0.8)", barButtonPosition: "left/right/nil", barButtonTitle: "Close", barTextFontName: "Futura", barTitleFontSize: 22, barButtonTextAttributes: [NSAttributedString.Key : Any]?, barButtonFontSize: 18, barButtonIconWidth: 0, barButtonIconHeight: 0, barButtonTintColor: "#ffffff")
[InviteReferrals setDefaultNavigationController: UINavigationController BarStyle: UIBarStyle PreferedStatusBarStyleLightContent: YES/NO BarSetTranslucent: YES/NO BarLoginScreenTitle: @"Login Screen Title" BarShareScreenTitle: @"Share Screen Title" BarInActiveCampaignScreenTitle: @"InActive Campaign Screen Title" BarTitleTextAttributes: NSDictionary<NSAttributedStringKey,id> BarTitleColor: "rgba()/#HexColorCode/nil" BarBackground: "rgba(227,188,99,0.8)" BarButtonPosition: "left/right/nil" BarButtonTitle: @"Close" BarTextFontName: @"Futura" BarTitleFontSize: 22 BarButtonTextAttributes: NSDictionary<NSAttributedStringKey,id> BarButtonFontSize: 18 BarButtonIconWidth: 0 BarButtonIconHeight: 0 BarButtonTintColor: @"#ffffff"];

Example -

a. Text Titles and Rgb/Hex Colors

InviteReferrals.setDefaultNavigationController(nil, barStyle: .default, preferedStatusBarStyleLightContent: false, barSetTranslucent: true, barLoginScreenTitle: "Login Screen Title", barShareScreenTitle: "Share Screen Title", barInActiveCampaignScreenTitle: "InActive Campaign Screen Title", barTitleTextAttributes: nil, barTitleColor: nil, barBackground: "rgba(227,188,99,0.8)", barButtonPosition: nil, barButtonTitle: "Close", barTextFontName: "Futura", barTitleFontSize: 22, barButtonTextAttributes: nilbarButtonFontSize: 18, barButtonIconWidth: 0, barButtonIconHeight: 0, barButtonTintColor: "#ffffff")
[InviteReferrals setDefaultNavigationController: nil BarStyle: UIBarStyleDefault PreferedStatusBarStyleLightContent: NO BarSetTranslucent: YES BarLoginScreenTitle: @"Login Screen Title" BarShareScreenTitle: @"Share Screen Title" BarInActiveCampaignScreenTitle: @"InActive Campaign Screen Title" BarTitleTextAttributes: nil BarTitleColor: nil BarBackground: @"rgba(227,188,99,0.8)" BarButtonPosition: nil BarButtonTitle: @"Close" BarTextFontName: @"Futura" BarTitleFontSize: 22 BarButtonTextAttributes: nil BarButtonFontSize: 18 BarButtonIconWidth: 0 BarButtonIconHeight: 0 BarButtonTintColor: @"#ffffff"];

b. Image Urls and Rgb/Hex Colors

InviteReferrals.setDefaultNavigationController(nil, barStyle: .default, preferedStatusBarStyleLightContent: false, barSetTranslucent: true, barLoginScreenTitle: "Login Screen Title", barShareScreenTitle: "Share Screen Title", barInActiveCampaignScreenTitle: "InActive Campaign Screen Title", barTitleTextAttributes: nil, barTitleColor: nil, barBackground: "https://d2gg9evh47fn9z.cloudfront.net/thumb_COLOURBOX8392247.jpg", barButtonPosition: nil, barButtonTitle: "https://s3.amazonaws.com/notifyvisitors/static/cross.png", barTextFontName: "Futura", barTitleFontSize: 22, barButtonTextAttributes: nil, barButtonFontSize: 18, barButtonIconWidth: 0, barButtonIconHeight: 0, barButtonTintColor: "#ffffff")
[InviteReferrals setDefaultNavigationController: nil BarStyle: UIBarStyleDefault PreferedStatusBarStyleLightContent: NO BarSetTranslucent: YES BarLoginScreenTitle: @"Login Screen Title" BarShareScreenTitle: @"Share Screen Title" BarInActiveCampaignScreenTitle: @"InActive Campaign Screen Title" BarTitleTextAttributes: nil BarTitleColor: nil BarBackground: @"https://d2gg9evh47fn9z.cloudfront.net/thumb_COLOURBOX8392247.jpg" BarButtonPosition: nil BarButtonTitle: @"https://s3.amazonaws.com/notifyvisitors/static/cross.png" BarTextFontName: @"Futura" BarTitleFontSize: 22 BarButtonTextAttributes: nil BarButtonFontSize: 18 BarButtonIconWidth: 0 BarButtonIconHeight: 0 BarButtonTintColor: @"#ffffff"];