Installation and Usage Guide
Card91 Reset ATM PIN iOS Framework
Card91 Reset ATM PIN iOS Framework Integration with Native iOS Apps
Description
Purpose of this document is to illustrate the method to add Card91 ‘Card91ResetAtmPin’ framework to any iOS native application written in Swift invoked either from a ViewController or an UIView.
Card91 'Card91ResetAtmPin' framework allows developers to add the custom webview component as per design.
Developers need to get the view onto their UIView and through invoking the viewDidLoad() method with certain required parameters mentioned below and a framework for changing the atm pin.
Installation
iOS Minimum Requirements :
Deployment Target Version - 14.0 or above
Usage
Below steps is defined to followed to integrate the Framework
Step:1
Add the xcframework file provided by us by drag and drop into the project "Frameworks,Libraries, and Embedded Content’ to “Embed & Sign".
ADD RESET ATM PIN VIEW COMPONENT ON UIVIEW
Framework will be ready to use after their adding on ViewController.
Create an IBOutlet of View(xib) and assign the “PinView” class to the view in the storyboard
Use this Card91ResetAtmPin framework by importing.
Make sure not to keep any background colour of the webview since it is supposed to be transparent.
SETUP RESET PIN VIEW COMPONENT
Get the instance of the added card91ResetAtmPin onto your ViewController.
As shown in the example below .
Set the Listener as given below
@IBOutlet weak var card91View: PinView!
override func viewDidLoad() {
super.viewDidLoad()
let popView = PinView.instanceFromNib(
self,
cardId: "****",
phoneNumber: "*****",
token: "**********",
env: "********",
templateId:"xoltt",
height: self.card91ResetAtmPin.frame.height,
width: self.card91ResetAtmPin.frame.width,
xAxis: UIScreen.main.bounds.origin.x,
yAxis: UIScreen.main.bounds.origin.y)
popView.delegate = self
self.card91ResetAtmPin.addSubview(popView)
}
INPUT PARAMETER DETAILS
Call the init() method of the Card91ResetAtmPin with the below parameter .
Name | Type | Required | Description |
---|---|---|---|
context | Context | true | Activity context or Fragment activity context is passed here |
cardId | string | true | cardId which has been received form login token service (Card91 API) |
token | string | true | Auth Token received from the Card91 APIs |
mobile | string | true | Mobile number of the card holder ( format +91-88**23 ) |
env | string | true | "PROD" in case of production and "PROD_SANDBOX" on sandbox environment |
height | double | true | Enter the Outlet frame height |
width | double | true | Enter the Outlet frame width |
xAxis | double | true | Enter the origin X-coordinates |
yAxis | double | true | Enter the origin Y-coordinates |
templateId | string | false | templateId eg:"xoltt" |
SUBSCRIBE FOR LISTENING CALLBACK EVENTS
Extend the protocol ResetAtmPinListener for listening to the call back event from the webview.
Interface has below and their usage .
func onPageFinished(message: String) {
print(message)
}
func onPageStarted(message: String) {
print(message)
}
func onPageError(message: String) {
print(message)
}
func onCard91ResetPinEvent(message: String) {
print(message)
}
onPageStarted is called when the webpage is loaded.
onPageFinished is called when webpage loading is finished .
onPageError is called when there is any error while loading the page.
onResetAtmEvent is called when card is initialised, detail is show, CVV is shown or copy card number event has happened.
DIFFERENT CALLBACLK EVENTS
The events are as follows:
Event Name | Description |
---|---|
C91_RESET_PIN_SUCCESS | Called when the server-side APIs load successfully. At this time, ATM pin change is successfully done. |
C91_RESET_PIN_AUTHENTICATION_FAILURE | Call back event type when client is passing incorrect or expired auth token. |
C91_RESET_PIN_MISSING_PARAMETER | Call back event type when client is not passing any required/blank parameter . |
C91_RESET_PIN_SERVER_FAILURE | Call back event type when there is server service exception with error code 500 to 599 |
C91_RESET_PIN_OTP_SCREEN_INITIALISED | Called when the server-side ATM pin changes OTP screen loads successfully. |