Save Traceability - ReconoSERID/SDK-ReconoSERID-Android GitHub Wiki

Save Traceability

Method to save the traceability from where the consumption of services is being performed, for such traceability is taken into account the type of event that you want to save the traceability.

Likewise, the traceability to be saved takes into account the operating system of the type of device (Android or iOS) along with the public ip where the device is connected, along with the geolocation where latitude and longitude are obtained. In addition, the screen resolution must be included along with the camera resolution.


#!java

public void onSaveTraceability(@NotNull SaveTraceabilityProcessIn saveTraceabilityProcessIn, @NotNull 
            OlimpiaInterface.CallbackSaveTraceability listener)
#!Kotlin

fun onSaveTraceability(saveTraceabilityProcessIn : SaveTraceabilityProcessIn, 
                                     listener: CallbackSaveTraceability)

Receives as parameters

Parameters

Parameter Type Required Description
SaveTraceabilityProcessIn Object YES Object with required parameters
CallbackSaveTraceability Callback YES Retorns SaveTraceabilityOut and RespuestaTransaccion

SaveTraceabilityProcessIn Parameters

Parameter Type Required Description
event String YES Event associated with the type of traceability to be performed
procesoConvenioGuid String YES Unique process identification
traceability Object YES Information associated with traceability (Object)
#!java

public SaveTraceabilityProcessIn( String evento,    //Event associated with the type of traceability to be performed
                          String procesoConvenioGuid,    //Unique citizen identification
                          Trazabilidad trazabilidad) //Information associated with traceability (Object)
                          
#!Kotlin

fun SaveTraceabilityProcessIn(evento : String, //Event associated with the type of traceability to be performed
                       guidProcesoConvenio : String ,    //Unique citizen identification
                       trazabilidad : Trazabilidad) //Information associated with traceability (Object)
                                               

Traceability Parameters

Parameter Type Required Description
device String YES Operating system of the connecting device (Android or iOS)
ip String YES Public IP of the device
latitud String YES Latitude where the device is located
lenguaje String YES Programming language associated with the application (JAVA, KOTLIN, SWITF, etc)
longitud String YES Length where the device is located
navegador String OPTIONAL Browser from which the request is made
resolucion String YES Device screen resolution
resolucionCamera String YES Device rear camera resolution
tiempo int OPTIONAL Current request time
userAgent String YES User storing information
versionNavegador String OPTIONAL Browser version from which the request is made
#!java

public Trazabilidad(      String device,      //Operating system of the connecting device (Android or iOS)
                          String ip,          //Public IP of the device
                          String latitud,     //Latitude where the device is located
                          String lenguaje,    //Programming language associated with the application (JAVA, KOTLIN, SWITF, etc)
                          String longitud,    //Length where the device is located
                          String navegador    //Browser from which the request is made
                          String resolucion,  //Device screen resolution
                          String resolucionCamera,      //Device rear camera resolution
                          int tiempo,          //Current request time
                          String userAgent,    //User storing information
                          String versionNavegador)    //Browser version from which the request is made 
                          
#!Kotlin

fun Trazabilidad( device: String ,      //Operating system of the connecting device (Android or iOS)
                  ip: String ,          //Public IP of the device
                  latitud: String ,     //Latitude where the device is located
                  lenguaje: String ,    //Programming language associated with the application (JAVA, KOTLIN, SWITF, etc)
                  longitud: String ,    //Length where the device is located
                  navegador: String ,   //Browser from which the request is made
                  resolucion: String ,  //Device screen resolution
                  resolucionCamera: String ,      //Device rear camera resolution
                  tiempo: int ,          //Current request time
                  userAgent: String ,    //User storing information
                  versionNavegador: String )      //Browser version from which the request is made 
                          

and returns the class ValidateDriverLicenseOut

SaveTraceabilityOut Parameters

Parameter Type Description
code int Code associated with the request
codeName String Name code associated with the request
RespuestaTransaccion List Transaction response
#!java

public SaveTraceabilityOut(int code, String codeName, RespuestaTransaccion respuestaTransaccion)
#!Kotlin

fun SaveTraceabilityOut(code : Int, codeName : String, respuestaTransaccion : RespuestaTransaccion)                    

Ex:

#!java

Trazabilidad trazabilidad = new Trazabilidad();
        trazabilidad.setDevice("Operating system of the connecting device (Android o iOS)");
        trazabilidad.setIp("IP device public");
        trazabilidad.setLatitud("Latitude where the device is located");
        trazabilidad.setLenguaje("Programming language associated with the application (JAVA, KOTLIN, SWITFF, etc)");
        trazabilidad.setLongitud("Length where the device is located");
        trazabilidad.setNavegador("");
        trazabilidad.setResolucion("Device screen resolution");
        trazabilidad.setResolucionCamera("Device rear camera resolution");
        trazabilidad.setTiempo(0);
        trazabilidad.setVersionNavegador("");
 
SaveTraceabilityProcessIn saveTraceabilityProcessIn = new SaveTraceabilityProcessIn();
        saveTraceabilityProcessIn.setEvento("UbicacionGeografica");
        saveTraceabilityProcessIn.setProcesoConvenioGuid(procesoConvenioGuid);    
        saveTraceabilityProcessIn.setTrazabilidad(trazabilidad);
       

        ServicesOlimpia.getInstance().onSaveTraceability(saveTraceabilityProcessIn, 
                                      new OlimpiaInterface.CallbackSaveTraceability() {
            @Override
            public void onSuccess(saveTraceabilityOut SaveTraceabilityOut) {
                //
            }

            @Override
            public void onError(RespuestaTransaccion transactionResponse) {
                //
            }
        });
#!Kotlin

val trazabilidad = Trazabilidad()
        trazabilidad.device("Operating system of the connecting device (Android o iOS)");
        trazabilidad.ip("IP device public");
        trazabilidad.latitud("Latitude where the device is located");
        trazabilidad.lenguaje("Programming language associated with the application (JAVA, KOTLIN, SWITFF, etc)");
        trazabilidad.longitud("Length where the device is located");
        trazabilidad.navegador("");
        trazabilidad.resolucion("Device screen resolution");
        trazabilidad.resolucionCamera("Device rear camera resolution");
        trazabilidad.tiempo(0);
        trazabilidad.versionNavegador("");

val saveTraceabilityProcessIn = SaveTraceabilityProcessIn()
        saveTraceabilityProcessIn.evento("UbicacionGeografica");
        saveTraceabilityProcessIn.procesoConvenioGuid(procesoConvenioGuid);    
        saveTraceabilityProcessIn.trazabilidad(trazabilidad);

        ServicesOlimpia.getInstance()
            .onSaveTraceability(
                saveTraceabilityProcessIn,
                object : OlimpiaInterface.CallbackSaveTraceability {

                    override fun onSuccess(saveTraceabilityOut: SaveTraceabilityOut?) {
                        //
                    }

                    override fun onError(transactionResponse: RespuestaTransaccion?) {
                        //
                    }
                })

...