Alipay+ DocsAlipay+ Docs

init

Call the init API to initialize the client SDK.

Note: The SDK is initialized after the first API call.

Method signature

copy
ACTapManager.getInstance(context).init(config)

Request parameters

Item

Type

Description

Required

config

APNFCConfig

Configuration settings for the SDK.

Required

APNFCConfig

Item

Type

Description

Required

Default value

authType

String

The authentication type.

Valid values are:

  • FLEXIBLE: The SDK's internal risk control determines password exemption. If a previous authentication is passed within 5 minutes, the password-exempted amount can be increased.
  • FLEXIBLE_WITHOUT_UPPER_AMOUNT: The SDK's internal risk control determines password exemption.
  • CDCVM_ALWAYS: Requires authentication for every transaction.

Optional

FLEXIBLE

isSupportTransit

Boolean

Whether to support transportation scenarios.

Valid values are:

  • true: supported
  • false: not supported

Optional

false

isSupportLockScreenPay

Boolean

Whether to support transportation payments when the screen is off.

Valid values are:

  • true: supported
  • false: not supported

Optional

false

isNeedConfirmActivate

Boolean

Whether secondary confirmation is required for card activation.

Valid values are:

  • true: supported
  • false: not supported

Optional

false

minNumberAllowedReplenish

Integer

The minimum Credential threshold for replenishment requests through the replenish API.

When local Credentials exceed this value, replenish calls return the REPLENISH_DENIED result code. This prevents unnecessary network requests.

Optional

10

autoReplenishThreshold

Integer

The threshold for automatic replenishment.

When Credentials fall below this threshold due to transactions, the SDK automatically triggers replenishment.

  • To trigger replenishment after every successful transaction, set to max integer (2^31 - 1).
  • To disable automatic replenishment, set to 0 or less.

Optional

10

amountLevel

String

The exempted password amount level. Pass in a positive integer as the initial value of this parameter.

Required

N/A

asyncAmountLimitSwitch

Boolean

Whether the amount limit switching is asynchronous.

Valid values are:

  • true: The switching is asynchronous.
  • false: The switching is not asynchronous.

Optional

false

canQueryAmountLimit

Boolean

Whether setting a limit is allowed for the query amount.

Valid values are:

  • true: allowed
  • false: not allowed

Optional

false

initMonitorDefault

Boolean

Whether to set NFCMonitor init status to false by default.

Valid values are:

  • true: Set the init status to false.
  • false: Set the init status to true.

Optional

false

isUseDefaultDeviceFingerPrint

Boolean

Whether the default device fingerprint is used.

Valid values are:

  • true: used
  • false: not used

Optional

false

Response parameters

N/A

Sample

copy
 private static APNFCConfig getDefaultSDKConfig() {
        APNFCConfig.Builder builder = new APNFCConfig.Builder()
                .setNeedConfirmActivate(true)
                .setAuthType(NFCAuthMode.FLEXIBLE_WITHOUT_UPPER_AMOUNT)
                .setSupportLockScreenPay(false);
        return builder.build();
    }