Alipay+ DocsAlipay+ Docs

registerPlugin

Call the registerPlugin API to register SPI plugins.

Method signature

copy
void registerPlugin(Class<T> clazz, T instance);

Request parameters

Item

Type

Description

Required

clazz

Class<T>

Extended plugins for injection. Available plugins for clazz injection, see Available SPI plugins.

Yes

instance

T

Corresponding instance.

Yes

Available SPI plugins

Each plugin corresponds to an API. Click the plugin name to view the API definition and implementation details.

Item

Description

Required

NFCRequestProxy

Proxy network requests.

Yes

TransactionPermit

Transaction authentication.

Yes

ConfigProxy

Proxy configurations. Enables the integrating party to customize configuration delivery and modify internal SDK implementation through multiple remote configuration projects.

Yes

LoggerProxy

Manages log output. Enables the integrator party to customize log printing to access internal SDK log output.

Yes

NFCMonitor

Monitors the events which are triggered inside the SDK.

Yes

ThreadPoolService

Implements and manages your own thread pool.

No

DeviceFingerPrintService

Enables the SDK to request device fingerprints from the MPP.

No

WalletInfoProvider

Provides wallet context, including location and foreground status, to enrich SDK telemetry data.

No

Note: The following two plugins have SDK-provided fallbacks:

  • ThreadPoolService: Falls back to a built-in thread pool implementation if not registered.
  • DeviceFingerPrintService: Falls back to a built-in implementation if not registered, provided that setUseDefaultDeviceFingerPrint(true) is set during initialization.

Response parameters

N/A

Sample

copy
ACTapManager manager = ACTapManager.getInstance(this.getApplication());
manager.registerPlugin(LoggerProxy.class, new CustomLogger());