Cordova
To continue with the implementation of the SDK, you must have The Cordova CLI installed. If you don't have it installed, you can install it with the following command:
npm install -g cordova
Quick start
Our team has created a simple plugin available for Android e iOS to facilitate the implementation of the SDK in your project. Request access to the plugin by sending an email to [email protected].
Once you have access to the plugin, you can install it with the following command:
cordova plugin add ../AKCordovaPlugin --link
Set up
1. JS/TS Configuration
The plugin has following input parameters for default:
let json = {
"config": {
"signature": "xxxx",
"clientId": "xxxx",
"clientPassword": "xxxx",
},
"flowId": "xxxx",
"country": "xxxx",
"docType": "xxxx",
"idNum": "xxxx"
}
Parameter | Description |
---|---|
signature | Signature of the application. |
clientId | Client Id of the application. |
clientPassword | Client password of the application. |
flowId | Flow Id of the account. |
country | Country of the user. |
docType | Document type of the user. |
idNum | Document number of the user. |
To call the plugin you have to add the following code in your file:
cordova.exec(success, error, "AKCordovaPlugin", "autentikar", [json]);
2. Android Configuration
To android configuration you mush the following previous guide Android.
The plugin for default implement the com.autentikar:core:4.2.0
and com.google.code.gson:gson:2.9.1
dependencies.
You must secure that AndroidManifest.xml
file has reference to the AKCordovaActivity
activity, also application property has android:theme
.
<activity android:name="com.autentikar.plugin.ak.AKCordovaActivity" />
3. iOS Configuration
To iOS configuration you mush the following previous guide iOS.
The plugin are implemented in Swift and Objective-C languages.
Modify the AKCordovaPlugin.swift
and AKCordovaPlugin.m
class with your own code.
Response
For obtain the result of the SDK in your JS/TS code you have to add the following code in your file:
function success(result) {
let json = JSON.parse(result)
console.log(json);
}
function error(error) {
console.log(error);
}