The Connectivity module automatically queues dispatches if the device reports no network connectivity, using Apple’s Reachability API to monitor the network connectivity.
Each time a tracking call is sent, the module checks the current connection status, and begins queueing requests if the internet is unreachable. Each time a new tracking call is received, it checks the connection status again, and if the connectivity state has changed to reachable again, previously queued requests are all sent, and the queue is cleared.
Additionally, as of 1.6.5, the connectivity status is automatically checked every 30 seconds by default (overridable via TealiumConfig) after the status has been detected as “not reachable.” If the status changes from “not reachable” to “reachable,” the queue is flushed automatically (meaning all tracking calls in the queue are dispatched).
The automatic connectivity check is canceled once the connectivity status changes to “reachable” and resumes when the status is detected as “not reachable.” This conserves resources by only monitoring for connection changes when strictly necessary.
Usage of this module is strongly recommended. Without it, dispatches fail and be dropped if the device is offline.
The following platforms are supported:
TealiumDispatchQueue. Not strictly a compile-time dependency, but dispatches are not successfully stored if this module isn’t included.
Install the Connectivity module with CocoaPods or Carthage.
To install the Connectivity module with CocoaPods:
Add the following pod to your Podfile:
Add the following required pod when using Connectivity module to persist dispatches:
The framework is auto-instantiated. It has a dependency on the TealiumCore pod. Learn more about CocoaPods installation for iOS.
To install the Connectivity module with Carthage, following these steps:
Go to the app target’s General configuration page in Xcode.
Add the following frameworks to the Embedded Binaries section: