Card
Currently, we have new version of the SDK available. (Click to see more information)
1.5.1 🚀 Latest
The Card library allows you to capture the user's card ID. This library depends of your user case and is optional.
Contact to support for obtain the step for register in AKCore
class.
Quick start
Add AKCardSwift
as a dependency
in your Package.swift
app.
https://github.com/Autentikar/card-spm.git
Dependencies
AKCardSwift
depends on AKCoreSwift
so you have to add AKCoreSwift
as a dependency in your Package Dependecies
.
Set up
Initialize SDK
Before continuing, you can set up the SDK with the following code, we recommend that you do this in the AppDelegate
class:
import AKCoreSwift
import AKCardCaptureSwift
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
.....
AKCore.register(for: AKCardCapture.getProtocol(step: .yourStepProvidedBySupport))
.....
return true
}
This will register the AKCardCapture
in the AKCore
class. This controller will be used to capture the card of the user, is mandatory to register this controller in the AKCore
class.
You can set up three diffrents steps.
Custom Theme
If you want to customize the theme of the AKCardCapture
you can to call CardCaptureCustomization()
functions for setting:
- Button: change theme of the button.
- LoadingScreen: change theme of the loading screen.
import AKCardCaptureSwift
let cardCaptureCustom = CardCaptureCustomization()
let cardCaptureButtonCustom = CardCaptureCustomization.Button()
let cardCaptureLoadingScreenCustom = CardCaptureCustomization.LoadingScreen()
let cardCaptureScreenCustom = CardCaptureCustomization.CaptureScreen()
cardCaptureCustom.backgroundColor = UIColor.your_background_color
cardCaptureCustom.cardRecapture = UIImage(named: "your_card_recapture")
cardCaptureCustom.textColor = UIColor.your_text_color
cardCaptureCustom.customFont = UIFont(name: "your_custom_font", size: UIFont.labelFontSize)
cardCaptureCustom.bundleForLocalizableString = Bundle(identifier: "your_identifier")!
cardCaptureCustom.backgroundColorContainer = UIColor.your_background_color_container
// Button
cardCaptureButtonCustom.backgroundColor = UIColor.your_background_color
cardCaptureButtonCustom.textColor = UIColor.your_text_color
cardCaptureButtonCustom.disableTextColor = UIColor.your_disable_text_color
cardCaptureButtonCustom.disableBackgroundColor = UIColor.your_disable_background_color
cardCaptureButtonCustom.customFont = UIFont(name: "your_custom_font", size: UIFont.labelFontSize)
// Loading Screen
cardCaptureLoadingScreenCustom.backgroundColor = UIColor.your_background_color
cardCaptureLoadingScreenCustom.showBackgroundImage = true | false
cardCaptureLoadingScreenCustom.backgroundImage = UIImage(named: "your_background_image")
cardCaptureLoadingScreenCustom.showLogo = true | false
cardCaptureLoadingScreenCustom.logo = UIImage(named: "your_logo")
cardCaptureLoadingScreenCustom.activityViewColor = UIColor.your_activity_view_color
cardCaptureLoadingScreenCustom.textColor = UIColor.your_text_color
cardCaptureLoadingScreenCustom.customFont = UIFont(name: "your_custom_font", size: 18)
// Capture Screen
cardCaptureScreenCustom.referenceFrameColor = UIColor.your_reference_frame_color
cardCaptureScreenCustom.closeImage = UIImage(named: "your_close_image")
cardCaptureScreenCustom.customFont = UIFont(name: "your_custom_font", size: 20)
cardCaptureCustom.buttonCustomization = cardCaptureButtonCustom
cardCaptureCustom.loadingScreenCustomization = cardCaptureLoadingScreenCustom
cardCaptureCustom.captureScreenCustomization = cardCaptureScreenCustom
AKCardCapture.setCustomization(customization: cardCaptureCustom)
Properties
This class has the following properties:
Principal screen
- backgroundColor: The background color.
- textColor: The color of text (titles, labels).
- cardRecapture: The icon of recapture card.
- customFont: The custom font. Deprecated
- customHeaderFont: The custom font for header (Title). Deprecated
- titleFont: The custom font for header (Title). New
- textFont: The custom font for text. New
- bundleForLocalizableString: The bundle for localizable string.
- backgroundColorContainer: The background color of image view empty container.
Button
- backgroundColor: The background color.
- textColor: The color of text. Deprecated
- textSecondaryColor: The color of button text "exit". Deprecated
- primaryTextColor: The color of text. New
- secondaryTextColor: The color of button text "exit". New
- disableTextColor: The color of text when the button is disabled.
- disableBackgroundColor: The background color when the button is disabled.
- custoFont: The custom font. Deprecated
- font: The custom font button. New
Loading Screen
- backgroundColor: The background color.
- showBackgroundImage: Show or hide the background image (default is false).
- backgroundImage: The background image (if showBackgroundImage is false this image not show).
- showLogo: Show or hide the logo (default is true).
- logo: The logo bottom (if showLogo is false this image not show).
- activityViewColor: The color of progress bar.
- textColor: The color of text.
- customFont: The custom font. Deprecated
- font: The custom font. New
Capture Screen
- referenceFrameColor: The reference frame of card.
- closeImage: The close image.
- customFont: The custom font. Deprecated
- font: The custom font. New
Texts (Localizable)
For change the texts of the principal screen, loading screen and capture screen you have to add or modify the Localizable.strings
file in your project, the keys are the following:
"CardGettingParams" = "Getting params";
"CardIDTitle" = "Capture your card ID";
"CardPassportTitle" = "Capture your Passport";
"CardPassportProcess" = "Processing Passport Capture";
"CardFrontLabel" = "Front Capture";
"CardBackLabel" = "Back Capture";
"CardCapture" = "Capture";
"Continue" = "Continue";
"Exit" = "Exit";
"Process" = "Processing Card ID Capture";
"InvalidCaptureTitle" = "Capture of invalid ID";
"InvalidCaptureMessage" = "It has not been possible to verify the veracity of the document.";
"RunnigError" = "Running Error";
"CardFront" = "FRONT CAPTURE\nAvoid glare, shadows or blurry photos.";
"CardBack" = "BACK CAPTURE\nAvoid glare, shadows or blurry photos.";
"Ok" = "OK";
"Recapture" = "Recapture";