beginSession
TypeScriptbeginSession(reply: ((arg0: boolean, arg1: (NativeError) | null) => void)): voidSwift declarationfunc beginSession() async throws -> Boolclass · iOS 9.0+ · SDK 27.1
class TKSmartCardbeginSession(reply: ((arg0: boolean, arg1: (NativeError) | null) => void)): voidSwift declarationfunc beginSession() async throws -> BoolendSession(): voidSwift declarationfunc endSession()static init(): TKSmartCardSwift declarationinit()transmit(request: ArrayBuffer, reply: ((arg0: (ArrayBuffer) | null, arg1: (NativeError) | null) => void)): voidSwift declarationfunc transmit(_ request: Data) async throws -> DatauserInteractionForSecurePINChange(PINFormat: TKSmartCardPINFormat, APDU: ArrayBuffer, currentPINByteOffset: number, newPINByteOffset: number): (TKSmartCardUserInteractionForSecurePINChange) | nullSwift declarationfunc userInteractionForSecurePINChange(_ PINFormat: TKSmartCardPINFormat, apdu APDU: Data, currentPINByteOffset: Int, newPINByteOffset: Int) -> TKSmartCardUserInteractionForSecurePINChange?userInteractionForSecurePINVerification(PINFormat: TKSmartCardPINFormat, APDU: ArrayBuffer, PINByteOffset: number): (TKSmartCardUserInteractionForSecurePINVerification) | nullSwift declarationfunc userInteractionForSecurePINVerification(_ PINFormat: TKSmartCardPINFormat, apdu APDU: Data, pinByteOffset PINByteOffset: Int) -> TKSmartCardUserInteractionForSecurePINVerification?get allowedProtocols(): TKSmartCardProtocolSwift declarationvar allowedProtocols: TKSmartCardProtocol { get set }set allowedProtocols(value: TKSmartCardProtocol)Swift declarationvar allowedProtocols: TKSmartCardProtocol { get set }get cla(): numberSwift declarationvar cla: UInt8 { get set }set cla(value: number)Swift declarationvar cla: UInt8 { get set }get context(): (unknown) | nullSwift declarationvar context: Any? { get set }set context(value: (unknown) | null)Swift declarationvar context: Any? { get set }get currentProtocol(): TKSmartCardProtocolSwift declarationvar currentProtocol: TKSmartCardProtocol { get }get isSensitive(): booleanSwift declarationvar isSensitive: Bool { get set }set isSensitive(value: boolean)Swift declarationvar isSensitive: Bool { get set }get slot(): TKSmartCardSlotSwift declarationvar slot: TKSmartCardSlot { get }get useCommandChaining(): booleanSwift declarationvar useCommandChaining: Bool { get set }set useCommandChaining(value: boolean)Swift declarationvar useCommandChaining: Bool { get set }get useExtendedLength(): booleanSwift declarationvar useExtendedLength: Bool { get set }set useExtendedLength(value: boolean)Swift declarationvar useExtendedLength: Bool { get set }get isValid(): booleanSwift declarationvar isValid: Bool { get }sendInsP1P2DataLeReply(ins: number, p1: number, p2: number, data: (ArrayBuffer) | null, le: (number) | null, reply: ((arg0: (ArrayBuffer) | null, arg1: number, arg2: (NativeError) | null) => void)): voidSwift declarationfunc send(ins: UInt8, p1: UInt8, p2: UInt8, data: Data? = nil, le: Int? = nil, reply: @escaping (Data?, UInt16, (any Error)?) -> Void)sendInsP1P2DataLe(ins: number, p1: number, p2: number, data?: (ArrayBuffer) | null, le?: (number) | null): { "sw": number; "response": ArrayBuffer }Swift declarationfunc send(ins: UInt8, p1: UInt8, p2: UInt8, data: Data? = nil, le: Int? = nil) throws -> (sw: UInt16, response: Data)Synchronously sends an APDU command to the smart card. Use this method when you need synchronous execution, such as within `withSession` blocks or when calling from synchronous code paths. - Parameters: - ins: Instruction byte of the APDU command. - p1: P1 parameter byte. - p2: P2 parameter byte. - data: Optional command data. - le: Optional expected response length. - Returns: A tuple containing the status word (sw) and response data. - Throws: An error if the command fails.
sendInsP1P2DataLe45476(ins: number, p1: number, p2: number, data?: (ArrayBuffer) | null, le?: (number) | null): Promise<{ "sw": number; "response": ArrayBuffer }>Swift declaration@backDeployed(before: macOS 27.0, iOS 27.0, tvOS 27.0, watchOS 27.0, visionOS 27.0)
final func send(ins: UInt8, p1: UInt8, p2: UInt8, data: Data? = nil, le: Int? = nil) async throws -> (sw: UInt16, response: Data)Asynchronously sends an APDU command to the smart card. In an async context, Swift prefers this overload over the synchronous `send(ins:p1:p2:data:le:) throws` method. To call the synchronous overload from an async context, use a typed function reference cast: `card.send as (UInt8, UInt8, UInt8, Data?, Int?) throws -> (UInt16, Data)` - Parameters: - ins: Instruction byte of the APDU command. - p1: P1 parameter byte. - p2: P2 parameter byte. - data: Optional command data. - le: Optional expected response length. - Returns: A tuple containing the status word (sw) and response data. - Throws: `CancellationError` if the task was cancelled before transmission, or an error if the command fails.
1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
TKSmartCard.withSession(_:)
synchronous callback requires a nonescaping JS-thread call