Swift -> volatileData getData() crash

Hello,

I am trying to get sessionId from volatileData and notice that when I call getData() my app crashes:

let config = ...
let tealium =  Tealium(config: config)
let data = tealium.volatileData()?.getData()   <-- crash here
let sessionId =  data[TealiumKey.sessionId] as? String

however I notice if i do the same in the init() endCompletion, everything works:

let tealium =  Tealium(config: config) { (_) in {
  let data = tealium.volatileData()?.getData()   
  let sessionId =  data[TealiumKey.sessionId] as? String
}

Can anyone tell me what i'm doing wrong?

Cheers.

d.

Accepted Solutions (0)

Answers (0)