Initialization
Follow these steps to initialize XpressPlug SDK for iOS native apps:
Invoke the Initialize method, where:
AppDelegateClass: Class that works as an entrypoint for the app.
Constants: Configuration parameters.
Resources: Necessary resources.
Modules: XpressPlug's extension modules implemented.
@objc public static func initialize( appDelegateClass: AnyClass, withConstants constants: [String: String], andResources resources: [String: String], andModules modules: [VTModuleProtocol])
Invoke XpressPlug's start method:
@objc public static func start( _ delegate: StartActionMessageDelegate }
Note
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) { } }
onProgressMessageUpdate
Is in charge of returning the XpressPlug's status to the main application.
onProgressPercentageUpdate
XpressPlug needs data connection to update certain functionalities. This function is in charge of showing the download progress for these updates.
XpressPlugNeedsUpdate
Is in charge of displaying if the application needs a more recent version of XpressPlug.
onFinish
Notifies that the start () method was executed correctly.
onError
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.