DispatchQueue Module
This module works in conjunction with the Connectivity module to store pending dispatches to disk while the device is offline. When connectivity is restored the queue of events is sent.
Usage
The DispatchQueue 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 are sent. There is a default limit of 20 dispatches in the queue, and when this is exceeded, the oldest dispatch are cleared to make way for the most recent. Data is stored in UserDefaults.
Usage of this module is required if using Consent Manager or Connectivity modules. Otherwise, it is still strongly recommended to aid with pre-init queueing of events by the TealiumCore module.
The following platforms are supported:
- iOS
- tvOS
- watchOS
- macOS
Install
Install the DispatchQueue module with CocoaPods or Carthage.
CocoaPods
To install the DispatchQueue module with CocoaPods, add the following pod to your Podfile:
pod 'tealium-swift/TealiumDispatchQueue'
The framework is auto-instantiated. It has a dependency on the TealiumCore
pod. Learn more about CocoaPods installation for iOS.
Carthage
To install the DispatchQueue module with Carthage, following these steps:
-
Go to the app target’s General configuration page in Xcode.
-
Add the following framework to the Embedded Binaries section:
TealiumDispatchQueue.framework
The framework is auto-instantiated. It has a dependency on TealiumCore
. No additional import statements are necessary. Learn more about Carthage installation for iOS.
Data Layer
The following variables are transmitted with each tracking call while the module is enabled:
Variable | Description | Example Value |
---|---|---|
was_queued |
Indicates that the dispatch was queued | ["true" , "false" ] |
API Reference
There are no public API methods for this module. Successes and failures may be monitored through the Delegate module.
The following additional methods are provided by the TealiumConfig
class:
setMaxQueueSize()
Sets the maximum persistent queue size for dispatch storage. Default is 20 events.
tealConfig.setMaxQueueSize(size)
Parameter | Type | Description | Example |
---|---|---|---|
size |
Int |
Maximum persistent queue size for dispatch storage (default: 20 ) |
50 |
getMaxQueueSize()
Gets the maximum queue size.
tealConfig.getMaxQueueSize();
Returns | Return Type |
---|---|
Maximum persistent queue size for dispatch storage | Int |
This page was last updated: January 7, 2023