Inicialización de iOS
Overview
D1Task is the main entry point to D1 SDK. It should be called as soon as the application is launched or at the earliest possible time. D1Task.Components is used to set a one-time configuration. The values can be retrieved from Thales delivery team.
Configure the D1 SDK
Create a D1Task instance
In SceneDelegate scene(:willConnectTo:options:), create a D1Task instance. Alternatively, in applications that do not use SceneDelegate, D1Task instance can be created in AppDelegate application(:didFinishLaunchingWithOptions:)
Use multi-issuer tokens
The issuer application can create multiple D1Tasks using multi-issuer tokens under the following conditions:
Each issuer token may include multiple
consumerIDas theSUB(subject) for the same issuer.A single login can be performed by providing all the issuer tokens which may include multiple
consumerIDseparated by spaces. Subsequently, additional operations can then be carried out across differentD1Tasks.
Example
var d1Task: D1Task!
let PUBLIC_KEY_EXPONENT: [UInt8] = [0x00, 0xa0] // Modulus bytes array
let PUBLIC_KEY_MODULUS: [UInt8] = [0x00, 0x00] // Exponent bytes array
var comp = D1Task.Components()
comp.d1ServiceURLString = ""
comp.issuerID = ""
comp.d1ServiceRSAExponent = Data(bytes: PUBLIC_KEY_EXPONENT, count: PUBLIC_KEY_EXPONENT.count)
comp.d1ServiceRSAModulus = Data(bytes: PUBLIC_KEY_MODULUS, count: PUBLIC_KEY_MODULUS.count)
comp.digitalCardURLString = ""
d1Task = comp.task()
// Initialize required SDKs
// Issuer application is required to provide consumerID
let consumerID = "" // obtained e.g. from server
let coreConfig = ConfigParams.coreConfig(consumerID: consumerID)
// required for Card Processing & Wallet Pay
let cardConfig = ConfigParams.cardConfig()
d1Task.configure([coreConfig, cardConfig]) { (errors) in
if let errors = errors {
for error in errors {
// Check error details to see whose config cause the errors, refer to D1 SDK Integration – Error Management section
}
}
}Última actualización
¿Te fue útil?