4. Initialize the NFC Wallet SDK
Initialize the NFC Wallet SDK
Initialize the NFC Wallet SDK before you call any other SDK API.
Recommended flow:
Add the required properties files.
Build a
CustomConfiguration.(Optional) Call
SDKInitializer.INSTANCE.configure(...)during app startup.Call
SDKInitializer.INSTANCE.initialize(...)on a background thread.Call
MobileGatewayManager.INSTANCE.configure(...)to configure Mobile Gateway (MG).
Add the required properties files
Create the following files in your Android digital wallet application assets folder:
mobilegateway.propertiesrages.propertiesgemcbp.properties
Set the values provided by Thales (unless a value is explicitly marked as fixed below).
mobilegateway.properties
rages.properties
gemcbp.properties
Configure payment behavior
CustomConfiguration defines payment behavior:
keyValidityPeriod: Time (in seconds) between end user authentication and the tap on the POS terminal. Range: 0–300. Default: 45.domesticCurrencyCode: ISO 4217 numeric currency code used for CDCVM during LVT (Low Value Transaction) payments. Default: 978 (EUR).
The SDK uses CustomConfiguration during initialization.
Run SDK quick configuration (optional)
Use SDKInitializer.INSTANCE.configure(...) to preload the Android Context, CustomConfiguration, and native libraries.
After configure(...) completes, you can call APIs that only read local SDK storage.
See SDK API requirements for details.
Initialize the SDK (payment)
Check the SDK state using SDKController.getInstance().getSDKServiceState() and only initialize when needed.
Use SDKInitializer.INSTANCE.initialize(...) to initialize the payment components:
Provide
CustomConfigurationas an input parameter.This API is synchronous. Call it from a background thread.
Configure Mobile Gateway (MG)
After SDK initialization completes, call MobileGatewayManager.INSTANCE.configure(...) to enable Tokenization, digital card LCM, and transaction history.
Use MobileGatewayManager.INSTANCE.getConfigurationState() to check configuration state.
Retrieve the wallet ID
Use getWalletId() from MGCardEnrollmentService to retrieve the wallet identifier.
MGSDKException is thrown if an error occurs while retrieving the wallet ID.
The SDK generates the wallet ID the first time you initialize the SDK:
The wallet ID remains stable across application restarts.
If you reset the SDK, the wallet ID is regenerated.
Last updated
Was this helpful?