Alipay+ DocsAlipay+ Docs

presentCurrentDeviceToken

Call the presentCurrentDeviceToken API to present the device token associated with the current user in Apple Wallet.

Method signature

copy
public static func presentCurrentDeviceToken(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 presentCurrentDeviceToken API.

Response parameters

N/A

Sample

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