Migration from version 1.x to 2.x
New features and changes were introduced in version 2.0 that are incompatible with version 1.x:
- Fingerprint generator configuration is now transferred in the deeplink. With this change, only
additionalDataare now required to sync between Source and Target application. WASTransporterno longer takes aDeviceFingerprintGeneratorparameter ininitand is using its own configuration that will prepare the generator for you.WASTransporterfunctionsvalidateandprocessare now part of the newly introducedWASProcessorto separate logic on the side of the Source and Target app.additionalDatais now required and part of theWASTransporterandWASProcessorinitializers.
Example change in the Source App
New code
let additionalData = "testWultraData".data(using: .utf8)!
let transporter = try! WASTransporter(
config: .semiStable(sameTeam: true, validityInSeconds: 10),
additionalData: additionalData
)
// rest of the transport is the same
Old code
let additionalData = "testWultraData".data(using: .utf8)!
let transporter = WASTransporter(
generator: try! DeviceFingerprintGenerator.semiStable(
forVendor: true,
withAdditionalData: additionalData,
validFor: 10
)
)
// rest of the transport is the same
Example change in the Target App
New code
let retrievedDeeplink: URL
let additionalData = "testWultraData".data(using: .utf8)!
let processor = WASProcessor(additionalData: additionalData)
let activationData = try processor.process(deeplink: url)
Old code
let retrievedDeeplink: URL
let additionalData = "testWultraData".data(using: .utf8)!
let transporter = WASTransporter(
generator: try! DeviceFingerprintGenerator.semiStable(
forVendor: true,
withAdditionalData: additionalData,
validFor: 10
)
)
let activationData = try transporter.process(deeplink: url)
Last updated on Nov 13, 2023 (14:00)
Edit on Github
Send Feedback