API to Start Library UI
Use the API for respective platforms to launch the Volt MX Iris Library from the Native app. This feature is available from V8 SP3 onwards. The Start Library API is available for Android, iOS, and Windows platforms.
Note: Calling this API from the Native app will internally call the appService callback of the Volt MX Iris Application.
Android
You must use this API to launch the library UI. This API must be called after the library is successfully initialized.
Note: You must call the Initialize Library API before using the Start Library API; otherwise, this method throws an exception.
Note: Avoid passing null to mandatory parameters as that results in an exception.
Package
com.voltmx.library
Class
VoltMXLibrary
Syntax
Input Parameters
Parameter | Description |
---|---|
libraryId | Specify the name of the library (VoltMX Iris Application AppID) that needs to be launched. This parameter cannot be null. |
activity | Specify the Native app activity that is used to start the main activity of the Volt MX Iris Library. This parameter cannot be null. |
libraryArgs | This parameter (key-value pair with supported values as primitive data types such as int, float, double, boolean, and String) is used to pass the native app’s data to the library (based on the contract of the library). > Note: libraryArgs are passed to the Volt MX Iris Application’s appService callback in new launch mode, which is known as library mode (whose constant is voltmx.application.APP_LAUNCH_MODE_LIBRARY). |
libraryConfig | The parameter that is used to configure the library. > Note: The libraryConfig parameter is currently ignored. You can pass null for this parameter. |
resultListener | Register a callback to send an acknowledgment (result) from Volt MX Iris Library to the Native app. This parameter cannot be null. > Note: The resultListener methods are called from the main/UI thread. |
Example
OnLibraryResultListener Interface
Package
com.voltmx.library
Class
VoltMXLibrary
Syntax
Methods
onLibraryResult
Parameters
Parameter Description libraryId Specifies the library for which the acknowledgment (result) is sent. resultData Specifies the result data in the form of key-value pairs.> Note: The library should publish the keys of resultData to let the Native app handle the resultData.
iOS
You must use this API to launch the library UI. This API must be called after the library is successfully initialized.
Note: You must call the Initialize Library API before using the Start Library API; otherwise, this method throws an exception.
Note: Avoid passing null to mandatory parameters as that results in an exception.
Import
<CoreComponent/VoltMXLibrary.h>
Class
VoltMXLibrary
Method
+ start : viewController: libraryArgs : libraryConfig: delegate:
Declaration
Input Parameters
Parameter | Description |
---|---|
libraryId | Specify the name of the library (VoltMX Iris Application AppID) that needs to be launched. This parameter cannot be null. |
viewController | Specify the Native app’s viewController reference to push the main UI controller into the library. |
libraryArgs | This parameter (key-value pair with supported values as primitive data types such as int, float, double, boolean, and String) is used to pass the native app’s data to the library (based on the contract of the library).> Note: libraryArgs are passed to the Volt MX Iris Application’s appService callback in new launch mode, which is known as library mode (whose constant is voltmx.application.APP_LAUNCH_MODE_LIBRARY). |
libraryConfig | The parameter that is used to configure the launch of the library.> Note: The libraryConfig parameter is currently ignored. |
resultDelegate | Register a delegate (that conforms to VoltMXLibraryResultDelegate) to send an acknowledgment (result) from Volt MX Iris Library to the Native app. This parameter cannot be null.> Note: The resultListener methods are called from the main/ UI thread. |
Protocol : VoltMXLibraryResultDelegate
Import
<CoreComponent/VoltMXLibrary.h>
Class
VoltMXLibrary
Method
(void)onLibraryResult: resultData:
Declaration
Parameters
Parameter | Description |
---|---|
libraryId | Specifies the library for which the acknowledgment (result) is sent. |
resultData | Specifies the result data in the form of key-value pairs.> Note: The library should publish the keys of resultData to let the Native app handle the resultData. |
Windows
You must use this API to launch the library UI. This API must be called after the library is successfully initialized.
Note: You must call the Initialize Library API before using the Start Library API; otherwise, this method throws an exception.
Note: Avoid passing null to mandatory parameters as that results in an exception.
Package
Framework
Class
VoltMXLibrary
Syntax
Parameters
Parameter | Description |
---|---|
libraryId | Specify the name of the library (VoltMX Iris Application AppID) that needs to be launched. This parameter cannot be null. |
libraryArgs | This parameter (key-value pair with supported values as primitive data types such as int, float, double, boolean, and String) is used to pass the native app’s data to the library (based on the contract of the library).> Note: libraryArgs are passed to the Volt MX Iris Application’s appService callback in new launch mode, which is known as library mode (whose constant is voltmx.application.APP_LAUNCH_MODE_LIBRARY). |
libraryConfig | The parameter that is used to configure the launch of the library.> Note: The libraryConfig parameter is currently ignored. |
resultListener | Register a callback to send the acknowledgment (result) from Volt MX Iris Library to the Native app. This parameter cannot be null. |
Note: The resultListener methods are called from the main/ UI thread.
ILibraryResultListener Interface
Package
Framework
Syntax
Methods
OnLibraryResult
Parameters
Parameter | Description |
---|---|
libraryId | Specifies the library for which the acknowledgment (result) is sent. |
resultData | Specifies the result data in the form of key-value pairs.> Note: The library should publish the keys of resultData to let the Native app handle the resultData. |