Migrate from 2.x to 3.0
Starting with TMG SDK 3.0.0, several public APIs are simplified.
Initialize the SDK
The SDK removes TMGClientConfiguration.Builder and moves configuration to the TMGClientConfiguration initializer:
Removed:
TMGClientConfiguration.BuilderUse instead:
TMGClientConfiguration
What changed
Deprecated
certificatePins. The SDK now manages certificate pinning internally.Renamed
serverUrltoserverURL.Renamed
serverKeyIdtoserverKeyID.
let serverUrl;
let serverCertificate;
let keyIdentifier;
let configurationBuilder = TMGClientConfiguration.Builder(serverUrl: serverUrl,
serverCertificate: Data(serverCertificate.utf8),
serverKeyId: keyIdentifier)
let configuration: TMGClientConfiguration = TMGClientConfiguration(builder: configurationBuilder)let serverURL = ""
let serverCertificate = ""
let serverKeyID = ""
let configuration = TMGClientConfiguration(serverURL: serverURL,
serverCertificate: Data(serverCertificate.utf8),
serverKeyID: serverKeyID)Initialize VisaCTFHelper
In TMG SDK 3.0.0, createVisaCTFHelper changes from async to sync. This simplifies error handling and control flow.
Update device binding flows (green and yellow)
Device binding covers device authentication, Identification and Verification (ID&V), and binding completion. In TMG SDK 3.0.0, the flow:
Standardized the use of
completionHandler.Removed the mix of
delegateandcompletionHandler.Removed the need to handle binding success in multiple places.
Streamlined control flow.
Use the code below to update your device binding integration:
Resume a binding (resumeBinding)
The resumeBinding flow is unchanged from earlier versions. Only the IDVSession (ID&V) steps change.
Get the binding state (bindingState)
In TMG SDK 3.0.0, bindingState changes from async to sync. This simplifies error handling and control flow.
Authenticate a transaction
Transaction authentication covers device authentication and returning the Visa payload. In TMG SDK 3.0.0, the flow:
Standardized the use of
completionHandler.Removed the mix of
delegateandcompletionHandler.
Use the code below to update your transaction authentication integration:
Remove a binding (removeBinding)
removeBinding now requires an additional correlationID.
Sync binding state (syncBindingState)
syncBindingState now requires an additional correlationID.
Read the previously selected ID&V method
In addition to the IDVSession functions used in the createBinding flow, you can read the previously selected ID&V method. In TMG SDK 3.0.0, previouslySelectedIDVMethod changes from async to sync. This simplifies error handling and control flow.
Last updated
Was this helpful?