Tealium Swift APIs - TealiumDataManager - 1.0.0 - 1.0.1

Tealium Swift APIs - TealiumDataManager - 1.0.0 - 1.0.1

by jason_koo on ‎12-01-2016 02:53 PM (193 Views)
FUNCTION NAME DESCRIPTION

addPersistentData(data : [String : AnyObject])

Add data to save with the library's persistent store.

deletePersistentData(keys : [String])

Remove saved data from the library's persistent store.

getPersistentData() Retrieve the existing persistent data as [String:AnyObject]

addVolatileData(data : [String : AnyObject])

Add data to all dispatches for this session only.

deleteVolatileData(keys : [String])

Remove data from the volatile data store.

getVolatileData() Retrieve the existing volatile data as [String:AnyObject]

getSessionId()

Get the current session id string

resetSessionId()

Reset the session id string 

 

ADD PERSISTENT DATA

Make data available through multiple app sessions.

addPersistentData(data:[String:AnyObject])
Parameters Description Example Value
dictionary Required dictionary to add. Values should be of type String or [String] only. ["key":"value"]
// SAMPLE
let customData = ["someKey":"someValue"]
tealium.getDataManager().addPersistentData(data:customData);

 

DELETE PERSISTENT DATA

deletePersistentData(keys:[String])
Parameters Description Example Value
Array Required array of Keys as strings ["key1", "key2"]
// SAMPLE
let keysToDelete = ["keyA", "keyB"]
tealium.getDataManager().deletePersistentData(keys:keysToDelete);

 

GET PERSISTENT DATA

getPersistentData()
Returns Description Example Value
Dictionary A [String:AnyObject] dictionary ["key1", "key2"]
// SAMPLE
let data : [String, AnyObject] = tealium.getDataManager().getPersistentData()

 

ADD VOLATILE DATA

Make data available to all calls for active session only.

addVolatileData(data:[String:AnyObject])
Parameters Description Example Value
dictionary Required dictionary to add. Values should be of type String or [String] only. ["key":"value"]
// SAMPLE
let customData = ["someKey":"someValue"]
tealium.getDataManager().addVolatileData(data:customData);

 

DELETE VOLATILE DATA

deleteVolatileData(keys:[String])
Parameters Description Example Value
Array Required array of Keys as strings ["key1", "key2"]
//SAMPLE
let keysToDelete = ["keyA", "keyB"]
tealium.getDataManager().deleteVolatileData(keys:keysToDelete);

 

GET VOLATILE DATA

getVolatileData()
Returns Description Example Value
Dictionary A [String:AnyObject] dictionary ["key1", "key2"]
// SAMPLE
let data : [String, AnyObject] = tealium.getDataManager().getVolatileData()

 

GET SESSION ID

getSessionId()
Returns Description Example Value
String String representation of a timestamp in milliseconds "1473371215123"
// SAMPLE
let sessionId = tealium.getDataManager().getSessionId()

 

RESET SESSION ID

Used to manually reset session id if needing to identify a new session other than at app start time.

resetSessionId()
Returns Description Example Value
String New String representation of a timestamp in milliseconds that will be added to all dispatches for the remainder of the current session. The returned String is for monitoring convenience as it is automatically added to the volatile data store when this method is called. "1473371215123"
// SAMPLE
tealium.getDataManager().resetSessionId()