Skip to main content

Veritran Docs

Inicialización

Después de su integración y parametrización, XpressPlug se debe inicializar para que se pueda invocar correctamente.

  1. [en] Invoke the Initialize method, where:

    • [en] AppDelegateClass: Class that works as an entrypoint for the app.

    • [en] Constants: Configuration parameters.

    • [en] Resources: Necessary resources.

    • [en] Modules: XpressPlug's extension modules implemented.

    @objc public static func initialize( 
            appDelegateClass: AnyClass, 
            withConstants constants: [String: String], 
            andResources resources: [String: String], 
            andModules modules: [VTModuleProtocol]) 
  2. [en] Invoke XpressPlug's start method:

    @objc public static func start( 
            _ delegate: StartActionMessageDelegate 
    } 

    Nota

    [en] The StartActionsMessageDelegate allows you to track the configuration download progress, and to know when it is available. See the example and table below to see the possible responses.

    // MARK: StartActionMessage Delegate 
    extension ViewController: StartActionMessageDelegate { 
      
      func onProgressMessageUpdate(message: String) {}   
    
      func onProgressPercentageUpdate(percentage: Int32) {}    
    
      func onFinish(_ entryPoint: String) { 
        print(“XpressPlug onFinish”) 
      }   
    
      func onError(_ errorId: Int32, message: String) { 
       } 
    } 

    [en] onProgressMessageUpdate

    [en] Is in charge of returning the XpressPlug's status to the main application.

    [en] onProgressPercentageUpdate

    [en] XpressPlug needs data connection to update certain functionalities. This function is in charge of showing the download progress for these updates.

    [en] XpressPlugNeedsUpdate

    [en] Is in charge of displaying if the application needs a more recent version of XpressPlug.

    [en] onFinish

    [en] Notifies that the start () method was executed correctly.

    [en] onError

    [en] Notifies that there was an error executing XpressPlug. It displays UA error codes and, in some cases, an error description. To learn more about these errors, go to Mobile Error Codes.