biocatch-ionic-module v1.0.6
BioCatch Mobile SDK Cordova support
Plugin de BioCatch Mobile SDK para Ionic con soporte de plataformas iOS y Android / BioCatch Mobile SDK plugin for Ionic with support for iOS and Android platforms
Translations
- Español / Spanish
- Ingles / English
- Portuguese
- Hebrew
Nuestro plugin de BioCatch Mobile SDK permite acceder a las funcionalidades nativas de las librerias del SDK de BioCatch desde TypeScript. / Our BioCatch Mobile SDK plugin allows us to access the native functionalities of the BioCatch SDK libraries from TypeScript.
Paso 1 / Step 1
Posicionarse en el directorio de proyectos de Ionic en el cual va a incluir la integración con BioCatch / Go to Ionic project directory in which you will include integration with BioCatch
Paso 2 / Step 2
Agregar el módulo de BioCatch seguido de los plugins necesarios para soporte nativo / Add the BioCatch module followed by the needed plugins for native support:
> npm i biocatch-ionic-module
> ionic cordova plugin add biocatch-cordova-plugin-ios
> ionic cordova plugin add biocatch-cordova-plugin-android
En caso de que el proyecto de android esté construido con librerías de "support" (pre Android X), usar el siguiente plugin: / In case the android project is built with support libraries (pre Android X), use the following plugin:
> ionic cordova plugin add biocatch-cordova-plugin-android-support
Paso 3 Configuración Nativa - Android / Step 3 Native Configuration - Android
Dentro del proyecto de Android, buscar el archivo proguard-rules.pro y agregar las siguientes líneas: / Inside the Android project, find the file proguard-rules.pro and add the following lines:
//BioCatch
-keep class com.biocatch.client.android.sdk.** { *; }
-keep class org.msgpack.** { *; }
-keep class sun.misc.** { *; }
Paso 4 Configuración Nativa - iOS / Step 4: Native Configuration - iOS
Dentro del proyecto iOS, seleccionar el target correspondiente a la aplicación, posteriormente seleccionar Build Settings y dentro de la sección "Build Options" buscar la opción "Always Embed Swift Standard Libraries" y asegurarse que esté en "YES" / Within the iOS project, select the target corresponding to the app, then select "Build Settings" and in the "Build Options" section look for the "Always Embed Swift Standard Libraries" option and make sure it is set to "YES"
Paso 5 / Step 5
Dentro del proyecto cordova, incluir la referencia al módulo y el proveedor de BioCath en el archivo app.modules.ts así como agregar el módulo al arreglo de imports y el provider al arreglo de proveedores: / Inside the cordova project, include the reference to BioCath module and provider in the app.modules.ts file, as well as adding the module to the imports array and the provider to the providers array:
import { BioCatchModule, BioCatchProvider } from 'biocatch-ionic-module';
...
@NgModule({
declarations: [AppComponent],
entryComponents: [],
imports: [
...
BioCatchModule
...
],
providers: [
...
BioCatchProvider
...
],
bootstrap: [AppComponent]
})
...
Paso 6 / Step 6
Finalmente, incluir en los módulos de la aplicación las llamadas a las rutinas de BioCatch de la siguiente manera: / Finally, include the calls to the BioCatch routines in the application modules as follows:
...
import { BioCatchProvider } from 'biocatch-ionic-module';
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage {
private wupServerHost = 'YOUR_WUP_SERVER_URL';
private customerId = 'YOUR_CUSTOMER_ID'
constructor(
...
private bioCatchProvider: BioCatchProvider,
...) {
}
//To start BioCatchSDK
async startBioCatch() {
var csid = this.generateCSID();
await this.bioCatchProvider.start(this.wupServerHost,
this.customerId,
csid);
}
//To change a context
testChangeContext(){
this.bioCatchProvicer.changeContext("Context_X");
}
//To update the Customer Session Id
testUpdateCustomerSessionId(){
//new csid
var csid = this.generateCSID();
this.bioCatchProvider.updateCustomerSessionId(csid);
}
function generateCSID() {
return "AUTO_GENERATED_VALUE"; //UUID RECOMENDED
}
}
...
Contacta a tu ingeniero de solución dedicado para obtener la url del servidor y el id de cliente así como para detalles de implementación. / Contact your dedicated solution engineer for the server url and customer id as well as well as implementation details.
Nota / Note
Dentro del directorio platforms se encuentran las carpetas correspondientes a iOS y Android para abrir los proyectos en Xcode o Android Studio según sea el caso. / Within the platforms directory there are the folders corresponding to iOS and Android to open the projects in Xcode or Android Studio as the case may be.