Swift Module: Dispatch Queue

Swift Module: Dispatch Queue

by 4 weeks ago (44 Views)

Purpose

This module works in conjunction with the Connectivity module and the Consent Manager module to store any pending dispatches to disk while the device is offline, or the user has not yet consented to tracking. When connectivity is restored, or if the user consents to tracking, the queue of dispatches will be sent. There is a default limit of 20 dispatches in the queue, and when this is exceeded, the oldest dispatch will be cleared to make way for the most recent. Data is stored in UserDefaults.

Supported Platforms

iOS, tvOS, watchOS, macOS

External Dependencies

Foundation

Recommended Usage

Usage of this module is recommended.

It is automatically included in Carthage and CocoaPods framework builds.

Included Variables

The following variables will be transmitted with each tracking call while the module is enabled:

Variable Name Description Example Value
was_queued Indicates that the dispatch was queued true

Public API

There are no public API methods for this module. Successes and failures may be monitored through the Delegate module.

TealiumConfig Methods

setMaxQueueSize

let config = TealiumConfig(account: "tealiummobile",
                profile: "demo",
                environment: "dev",
                datasource: "test12",
                optionalData: nil)
config.setMaxQueueSize(50)

Sets the maximum persistent queue size for dispatch storage.

getMaxQueueSize

let config = TealiumConfig(account: "tealiummobile",
                profile: "demo",
                environment: "dev",
                datasource: "test12",
                optionalData: nil)
config.setMaxQueueSize(50)

let queueSize: Int = config.getMaxQueueSize()

Gets the maxiumum queue size set on the TealiumConfig object.

Future Improvements

No planned changes

Change Log

Build 1

  • Initial release