Alipay+ DocsAlipay+ Docs

canAddToCurrentDevice

Call the canAddToCurrentDevice API to check whether the current device is capable of adding the token.

Method signature

copy
public static func canAddToCurrentDevice(completion: @escaping (Result<Bool, IAPAPErrors>) -> Void)

Request parameters

Parameter

Type

Required

Description

completion

(Result<Bool, IAPAPErrors>) -> Void

Yes

An asynchronous completion callback that returns the result of calling the canAddToCurrentDevice API.

Response parameters

N/A

Sample

copy
IAPApplePay.canAddToCurrentDevice { result in
    switch result {
    case .success(let isSuccess):
        print("canAddToCurrentDevice success: \(isSuccess)")
    case .failure(let error):
        print("canAddToCurrentDevice error: \(error)")
    }
}