iOS
This page details how to add the ReadyRemit SDK Package to your Project for iOS
Step 1 - Download the SDK
Version specification
You will find two versions of ReadyRemitSDK
• ReadyRemitSDK.zip - This is the full version that includes the KYC feature
• ReadyRemitSDKLite.zip - This is the version that does not include the KYC feature
You should implement just one of these into your project
- Download the
ReadyRemitSDK.zip
orReadyRemitSDKLite.zip
from here. - Unzip the file
- Create a
Frameworks
folder under your root project folder - Paste the unzipped
ReadyRemitSDK.xcframework
orReadyRemitSDKLite.xcframework
into the newly createdFrameworks
folder
Step 2 - Add the SDK to your project
- Open your Project in XCode and go to the Project -> General -> Frameworks, Libraries, and Embedded Content.
- Drag and drop the downloaded SDK into the "Frameworks, Libraries, and Embedded Content" section of the settings.
Step 3 - Install required libraries
- Download the
VisaSensoryBranding.zip
file from Github. - Extract the contents of the zip file and add the extracted library folder to the newly created "Frameworks" directory.
- In XCode select your main target in the "Project Navigator" window and switch to the "General" tab.
- Under "Frameworks, Libraries and Embedded Content" drag and drop the
VisaSensoryBranding.xcframework
folder
Step 4 - Implement ReadyRemit Delegate
Open the View Controller you will be launching the ReadyRemit SDK from, and add the ReadyRemitDelegate protocol to the ViewController class definition. (You will need to import the ReadyRemit SDK.)
You will want to conform it to the protocol by adding two functions.
The first function gets an Auth Token. This function will have two callbacks. One is to run if the call back is successful, and a second is a failure.
Security Warning
The Auth Token can be used to view users' personal information and bank information. Because of this, you should never store it in long-term storage.
//ReadyRemitSDK
import ReadyRemitSDK
//ReadyRemitSDKLite
import ReadyRemitSDKLite
class ViewController: UIViewController, ReadyRemitDelegate {
...
func onAuthTokenRequest(success: @escaping (String) -> Void,
failure: @escaping () -> Void) {
// If token is available
let authToken = "ACCESS_TOKEN_FROM_SERVER";
success(authToken)
..
// If token is unavailable
failure()
}
}
The second function is the onSubmitTransfer function. You should make an API call to your server with the TransferRequest data through this function. This gives you a TransferId in return which you will give to the SDK.
import ReadyRemitSDK
//ReadyRemitSDK
import ReadyRemitSDK
//ReadyRemitSDKLite
import ReadyRemitSDKLite
class ViewController: UIViewController, ReadyRemitDelegate {
...
func onSubmitTransfer(transferRequest: ReadyRemit.TransferRequest,
success: @escaping (String) -> Void,
failure: @escaping (String, String) -> Void) {
// Make an API call to your server with the TransferReqeust data
// Expect a transferId to be returned
let transferId = "abc"
success(transferId)
..
// If token is unavailable
let errorMessage = "error message from server"
let errorCode = "error code from server"
failure(errorMessage, errorCode)
}
}
Step 5 - Initialize your SDK
The last step is to initialize the SDK.
Note on UINavigationController
The ReadyRemit SDK initialization requires that the ViewController launching the SDK has a parent NavigationController available.
guard let controller = self.navigationController else {
// ERROR handling in case the navigation controller isn't available
return;
}
ReadyRemit.shared.environment = .sandbox // Value can be .sandbox or .production
ReadyRemit.shared.launch(inNavigation: controller, delegate: self) {}
(Optional) Style the ReadyRemit SDK
You can style the SDK following this example
- Colors
let colors = createColors()
colors.background = UIColor(lightHex: "#FEE598", darkHex: "#6D071A");
colors.foreground = UIColor(lightHex: "#B7D7A9", darkHex: "#654343");
colors.buttonText = UIColor(lightHex: "#D5A6BD", darkHex: "#CFE010");
colors.buttonColor = UIColor(lightHex: "#9801FF", darkHex: "#7030A0");
colors.danger = UIColor(lightHex: "#44808E", darkHex: "#44808E");
colors.dangerLight = UIColor(lightHex: "#6FA8DC", darkHex: "#6FA8DC");
colors.divider = UIColor(lightHex: "#670001", darkHex: "#660000");
colors.icon = UIColor(lightHex: "#FE0100", darkHex: "#0100FE");
colors.inputLine = UIColor(lightHex: "#008761", darkHex: "#008761");
colors.primary = UIColor(lightHex: "#9801FF", darkHex: "#7030A0");
colors.primaryLight = UIColor(lightHex: "#9801FF", darkHex: "#7030A0");
colors.success = UIColor(lightHex: "#B55F07", darkHex: "#FEBF01");
colors.text = UIColor(lightHex: "#0100FE", darkHex: "#FEE598");
colors.textSecondary = UIColor(lightHex: "#BC2601", darkHex: "#B7D7A9");
ReadyRemit.shared.appearance = ReadyRemitAppearance(colors: colors)
- Fonts
Utilizing Custom Fonts
To employ a custom font, please make sure it is correctly installed within your application. Also, ensure that it includes semi-bold and bold variations for a complete experience.
ReadyRemitFontScheme.defaultFamily = "Arial"
(Optional) Closing ReadyRemitSDK
If you wish to gracefully close the ReadyRemitSDK at any point in your code, you can achieve this with the following method:
func closeReadyRemitSDK() {
ReadyRemit.shared.close()
}
(Optional) Inactivity Detector
If you prefer to automatically close the ReadyRemitSDK when your users are inactive, you can use the following snippet. Place it in your activity where you launch the SDK.
import UIKit
class YourViewController : UIViewController() {
@IBAction private func onSendMoney(_ sender: Any) {
guard let controller = self.navigationController else {
// ERROR handling in case the navigation controller isn't available
return
}
// Launch ReadyRemitSDK
ReadyRemit.shared.environment = .sandbox // Value can be .sandbox or .production
ReadyRemit.shared.launch(inNavigation: controller, delegate: self) {}
// Set inactivity timeout (e.g., 60 seconds)
ReadyRemit.shared.close(afterSeconds: 60)
}
}
(For KYC users only) Implement KYC
If you wish to use the ReadyRemitSDK with the KYC feature enabled, these are the steps to implement required additional libraries.
- Download
KYC_Frameworks.zip
file from Github. - Extract the contents of the zip file and add all the extracted library folders to the newly created "Frameworks" directory.
- In XCode select your main target in the "Project Navigator" window and switch to the "General" tab.
- Under "Frameworks, Libraries and Embedded Content" drag and drop the all new pasted folders
- In XCode, open your info.plist file and add a new key for
Privacy - Camera Usage Description
with a value explaining why you need to use the camera. We recommend the following text:
Verify my identity per KYC standards before I can start sending money to recipients
- Add new strings localized strings to your project. Follow Apple's guide for supporting languages and regions in iOS applications.
"acuant_camera_align" = "ALIGN";
"acuant_camera_manual_capture" = "ALIGN & TAP";
"acuant_camera_move_closer" = "MOVE CLOSER";
"acuant_camera_hold_steady" = "HOLD STEADY";
"acuant_camera_capturing" = "CAPTURING";
"acuant_camera_outside_view" = "TOO CLOSE!";
"acuant_face_camera_initial" = "Align face to start capture";
"acuant_face_camera_face_too_close" = "Too Close! Move Away";
"acuant_face_camera_face_too_far" = "Move Closer";
"acuant_face_camera_face_has_angle" = "Face has Angle. Do not tilt";
"acuant_face_camera_face_not_in_frame" = "Move in Frame";
"acuant_face_camera_face_moved" = "Hold Steady";
"acuant_face_camera_capturing_2" = "Capturing\n2...";
"acuant_face_camera_capturing_1" = "Capturing\n1...";
"idology_header_title" = "Please capture the front of the ID";
"idology_retry" = "Retry";
"idology_cancel" = "Cancel";
"idology_confirm" = "Confirm";
"idology_captureBack" = "If you are satisfied please confirm and capture the back of the document";
"idology_captureSelfie" = "If you are satisfied please confirm and please take a selfie";
"idology_thankYou" = "If you are satisfied with all the images, please confirm";
"idology_start" = "Start";
"acuant_camera_align" = "CENTRAR";
"acuant_camera_manual_capture" = "CENTRE Y TOQUE LA PANTALLA";
"acuant_camera_move_closer" = "ACÉRQUESE";
"acuant_camera_hold_steady" = "MANTÉNGASE FIRME";
"acuant_camera_capturing" = "CAPTURANDO";
"acuant_camera_outside_view" = "¡MUY CERCA!";
"acuant_face_camara_initial" = "Centre su rostro para tomar la foto";
"acuant_face_camera_face_too_close" = "¡Muy cerca! Retroceda";
"acuant_face_camera_face_too_far" = "Acérquese";
"acuant_face_camera_face_has_angle" = "Su rostro está inclinado. Por favor no lo incline";
"acuant_face_camera_face_not_in_frame" = "Muévase dentro del marco";
"acuant_face_camera_face_moved" = "Mantenga el teléfono estable";
"acuant_face_camera_capturing_2" = "Capturando\n2...";
"acuant_face_camera_capturing_1" = "Capturando\n1...";
"idology_header_title" = "Capture el frente de la identificación";
"idology_retry" = "Reintentar";
"idology_cancel" = "Cancelar";
"idology_confirm" = "Confirmar";
"idology_captureBack" = "Si está satisfecho, confirme y capture el dorso del documento";
"idology_captureSelfie" = "Si está satisfecho, confirme y tome una foto de su rostro";
"idology_thankYou" = "Si está satisfecho con las imágenes, por favor confirme";
"idology_start" = "Comenzar";
Updated 3 months ago